Odoo Help


Add new field to the product form:

Nigel Butler
on 2/22/16, 10:11 AM 1,102 views

I have created a new module which adds a field to the product form called 'Drawing Number'

I have created the field 'drawing' in the models file and inherited the data from product.template.

class HIP_product_template(models.Model):

_name = 'product.template'

_inherit = 'product.template'

drawing = fields.Char('Drawing Number', required = False)

I have then edited the view in the xml file as follows:

<record model="ir.ui.view" id="HIP_product_template">

<field name="inherit_id" ref="product.product_template_only_form_view"/>

<field name="model">product.template</field>

<field name="arch" type="xml">

<field name="list_price" position="after">

<field name="drawing" placeholder="Drawing no./issue" required="False"/>




This works great, and I can add this new field to all my products. I can also display the field in quotes etc. 

However, if you click Quotation, then click Add an Item, and 'Create and Edit' this brings up the new product form, but it does not contain my adjustments. I cannot find where this alternative form view is coming from as the pop up has no debug options to edit or view the form. 

I have searched all XML documents on addons for <field name="default_code" which also appears on this for, and also <field name="barcode" but I cant locate this strange pop up products form. 

Did you check the 'product_template_form_view' in product module.

Gopakumar N G
on 2/25/16, 1:08 AM

Thanks Gopakumar N G. It was actually product.product_normal_form_view, and the model had to be product.product, not product.template. The following code seems to have worked: product.product Part Number Part No. Barcode for D-Note

Nigel Butler
on 2/25/16, 8:41 AM
product.product Part Number Part No. Barcode for D-Note
Nigel Butler
on 2/25/16, 8:42 AM

I cant paste the code in here, but its same as in the original question but with name="inherit_id" ref="product.product_normal_form_view" and name="model">product.product

Nigel Butler
on 2/25/16, 8:43 AM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 2/22/16, 10:11 AM
Seen: 1102 times
Last updated: 2/22/16, 10:17 AM