[FIX] sale_stock: restore clean inheritance
Inheritance with position=attributes has been introduced at bf70bde346 but was
screwed up during conflict resolution of merges and lost some inheritance
or got the one on product_id to be duplicated.
Set inheritance with position=attributes everywhere.
Add comments to explain when product_uos should be kept or not.
This commit is contained in:
@@ -33,27 +33,36 @@
|
||||
<field name="picking_policy" required="True"/>
|
||||
</group>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']/form//field[@name='product_id']" position="replace">
|
||||
<field name="product_id"
|
||||
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
|
||||
groups="base.group_user"
|
||||
on_change="product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,False,product_uos_qty,False,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, context)"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']/tree//field[@name='product_id']" position="replace">
|
||||
<field name="product_id"
|
||||
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
|
||||
groups="base.group_user"
|
||||
on_change="product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,False,product_uos_qty,False,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, context)"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']/form//field[@name='product_id']" position="replace">
|
||||
<field name="product_id"
|
||||
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom}"
|
||||
groups="base.group_user"
|
||||
on_change="product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,False,product_uos_qty,False,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, context)"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']/tree//field[@name='product_uom_qty']" position="attributes">
|
||||
<attribute name="on_change">product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,False,name,parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position, True, parent.warehouse_id, context)</attribute>
|
||||
<xpath expr="//field[@name='order_line']/form//field[@name='product_id']" position="attributes">
|
||||
<!-- no product_uos to force reset of product_uom, product_uos and product_uos_qty in porduct_id_change -->
|
||||
<attribute name="on_change">product_id_change_with_wh(
|
||||
parent.pricelist_id, product_id, product_uom_qty, False, product_uos_qty, False, name,
|
||||
parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position,
|
||||
False, parent.warehouse_id, context)
|
||||
</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']/tree//field[@name='product_id']" position="attributes">
|
||||
<attribute name="on_change">product_id_change_with_wh(
|
||||
parent.pricelist_id, product_id, product_uom_qty, False, product_uos_qty, False, name,
|
||||
parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position,
|
||||
False, parent.warehouse_id, context)
|
||||
</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']/form//field[@name='product_uos_qty']" position="attributes">
|
||||
<!-- keep product_uos to force update of product_uom and product_uom_qty in porduct_id_change -->
|
||||
<attribute name="on_change">product_id_change_with_wh(
|
||||
parent.pricelist_id, product_id, product_uom_qty, False, product_uos_qty, product_uos, name,
|
||||
parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position,
|
||||
False, parent.warehouse_id, context)
|
||||
</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']/form//field[@name='product_uom_qty']" position="attributes">
|
||||
<attribute name="on_change">product_id_change_with_wh(
|
||||
parent.pricelist_id, product_id, product_uom_qty, product_uom, product_uos_qty, False, name,
|
||||
parent.partner_id, False, False, parent.date_order, product_packaging, parent.fiscal_position,
|
||||
True, parent.warehouse_id, context)
|
||||
</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//group[@name='technical']" position="inside">
|
||||
<field name="shipped" groups="base.group_no_one"/>
|
||||
<field name="invoice_exists" invisible="1" groups="base.group_no_one"/>
|
||||
|
||||
Reference in New Issue
Block a user