Odoo Help

Pascal Tremblay
On 3/30/17, 3:18 PM

In a purchase order, when you added a new purchase order line, to have the partner_id of the purchase order in the context when the name_search method is trigerred, you just have to modify the context of the product_id field.


<record id="purchase_order_form_inherited" model="ir.ui.view">
            <field name="name">purchase.order.form.inherited</field>
            <field name="model">purchase.order</field>
            <field name="inherit_id" ref="purchase.purchase_order_form" />
            <field name="arch" type="xml">
                <xpath expr="//field[@name='order_line']//field[@name='product_id']" position="attributes">
                    <attribute name="context">{'partner_id':parent.partner_id}</attribute>


About This Community

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

Question tools

1 follower(s)


Asked: 3/29/17, 12:28 PM
Seen: 1130 times
Last updated: 3/30/17, 3:18 PM