Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

How add custom attributes to product ( V8 )

By
Harmstra
on 7/28/14, 9:16 AM 8,495 views

Haven't found any conclusive information on this yet. Let's say I want to have a text field for the color of my product. Can anyone explain in a clear way, step by step, how to  do this? 

0

Koffi KPONOUGLO

--Koffi KPONOUGLO--
768
| 5 2 6
Lomé, Togo
--Koffi KPONOUGLO--

Koffi KPONOUGLO

Koffi KPONOUGLO
On 7/28/14, 10:52 AM

The steps to add custom attributes to product is : 

  1. Activation of developer mode
  2. Go to product form : Sale-> Products -> Products -> Form view -> In the field "Debug view"  select "manage views"->  Edit -> (Select the place wher you want to put you custom field) -> Enherited view 
  3. Enherit the view : clic on Enherited view (when you clic on this bouton you will get another new node.)
  4. Adding your custom attribute : Go inside the new node created. clic on the icon "plus" at right -> New field -> Field name -> Field label -> Field type -> Save -> Update -> String(lLabel of field) -> Update -> Close -> Close

It is finished.

0
Harmstra
On 7/28/14, 10:05 AM

Ok, thanks.  That's is how to do it programatically, which we might want to do in the future, but what are te steps to follow using the Odoo web interface?

 

Good question. I have never done it that way because of the risk of losing all adjustments after updating, so I guess another help-person should handle this question.

Ludo - Neobis
on 7/28/14, 10:40 AM

If you add a new custom field using the x_... naming convention we are told that this will survive updates. You should not have to be a programmer and to have to create a module to simply add an additional field to one of the models. You aren't even allowed to add your own modules if you are running on the Odoo hosted saas system - this is how customisation is achieved there - see here:- http://www.slideshare.net/openobject/how-to-customize-views-menues-of-open-erp-online-in-a-sustainable-way-frederic-gilson

Hertford Developments Limited, Kurt Haselwimmer
on 7/28/14, 4:09 PM

Interesting post kurt. I did not know that. I thought it was just a convention, but did not realise that it is an actual rule.

Ludo - Neobis
on 7/29/14, 3:18 AM
0

Fabien Pinckaers (fp)

--Fabien Pinckaers (fp)--
6598
| 6 8 8
fsdsdfsdf, Belgium
--Fabien Pinckaers (fp)--

Odoo Founder & CEO

Fabien Pinckaers (fp)
On 7/28/14, 4:43 PM

Odoo version 8 support natively attributes; any kind of attributes directly on the product form. In version 7 there is a basic module that add attributes on products: (don't remember the name but it's something like product_mrp_attribute)

Fabien, could you elaborate a bit more on this? Or point me to the corresponding docs?

Harmstra
on 7/29/14, 5:03 AM

Hello Fabian, Odoo V8 is natively supports attributes but those are not as per general requirement. Odoo provided attribute feature for to connect product template and Product object. The actual usage is if in product.product object ( not product template ) if anyone want to add new attribute of product then ? what they do ? If they add attribute and value in template then with cross join odoo will create new products. But that we are not looking for. If you aware with Magento system, we can add new attribute and set value. In kind of ecommerce system, different product have different attributes. So to deal with that we can't go for to create new column everytime but there should be something like attributes with one2many relation with product.product ( Not with template ) so that we can select attribute and give value. I hope you get me what i trying to say.

Hiren Vora - CEO at Emipro Technologies Pvt. Ltd. India
on 9/9/14, 5:51 AM

Where can we add those attributes in the UI? I have v8 before me and I don't see any menu item where you can add them, and I have enabled "Support custom product attributes". Or do you mean extending product attributes by writing a custom module?

Hiro Kobayashi
on 9/15/14, 9:51 AM
0

Ludo - Neobis

--Ludo - Neobis--
2387
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--

Developer

Ludo - Neobis
On 7/28/14, 9:36 AM

This piece of documentation will help out any developer:

https://doc.odoo.com/trunk/server/03_module_dev/

Especially the subject of object inheritance. 

In simple steps:

  • Create a module
  • Create a file for overriding product.product (since you want to add a field).
  • Add the field in code
  • Install module
  • Presto!

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/28/14, 9:16 AM
Seen: 8495 times
Last updated: 11/30/15, 2:39 AM