Odoo Help


How to add a new column in purchase order

Senthil Kumar
on 1/6/16, 11:47 PM 693 views

Can anyone please let me know how to add a new column in Purchase Order in products tab in v8

--Jignesh Mehta--

Jignesh Mehta
On 1/7/16, 3:09 AM

Hello Senthil,

Inherit product.product and add field which you want to add.

then inherit the view of purchase order form which is purchase_order_form and then in the tree view of order_line field add your field.

Ex :-

In Py:-

class product.product(models.Model)

     _inherit = 'product.product'

     custom_field = fields.Float('Field Name')

In Xml:-

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

    <field name="name">inherit.purchase.order.form.view</field>

    <field name="model">purchase.order</field>

    <field name="inherit_id" ref="purchase.purchase_order_form"/>

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

        <xpath expr="/form/sheet/notebook/page[1]/field[@name='order_line']/tree/field[@name='name']" position="after">

            <field name="custom_field"/>




Hope it works for you.


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: 1/6/16, 11:47 PM
Seen: 693 times
Last updated: 1/7/16, 3:09 AM