Files
stock-logistics-warehouse/purchase_packaging/views/purchase_views.xml
Laetitia Gangloff 8b4a5bb3ef correct xml view
2019-06-05 10:42:28 +02:00

53 lines
3.0 KiB
XML

<?xml version="1.0"?>
<openerp>
<data>
<record id="purchase_order_view_form_inherit_purchase_packaging" model="ir.ui.view">
<field name="name">purchase.order.form (purchase_packaging)</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="//page[@string='Products']//field[@name='order_line']/tree[@string='Purchase Order Lines']/field[@name='product_id']" position="after">
<field name="product_tmpl_id" invisible="1"/>
<field name="packaging_id" domain="[('product_tmpl_id','=',product_tmpl_id)]" groups="product.group_stock_packaging"/>
</xpath>
<xpath expr="//page[@string='Products']//field[@name='order_line']/tree[@string='Purchase Order Lines']/field[@name='product_qty']" position="attributes">
<attribute name="readonly">1</attribute>
</xpath>
<xpath expr="//page[@string='Products']//field[@name='order_line']/tree[@string='Purchase Order Lines']/field[@name='product_qty']" position="before">
<field name="product_purchase_qty"/>
<field name="product_purchase_uom_id" groups="product.group_uom"/>
</xpath>
<xpath expr="//page[@string='Products']//field[@name='order_line']/tree[@string='Purchase Order Lines']/field[@name='product_uom']" position="attributes">
<attribute name="attrs">{'readonly' : [('packaging_id', '!=', False)]}</attribute>
</xpath>
</data>
</field>
</record>
<record id="purchase_order_line_view_form_inherit_purchase_packaging" model="ir.ui.view">
<field name="name">purchase.order.line.form (purchase_packaging)</field>
<field name="model">purchase.order.line</field>
<field name="inherit_id" ref="purchase.purchase_order_line_form"/>
<field name="arch" type="xml">
<data>
<field name="product_qty" position="attributes">
<attribute name="readonly">1</attribute>
</field>
<label for="product_qty" position="before">
<field name="product_tmpl_id" invisible="1"/>
<field name="packaging_id" domain="[('product_tmpl_id','=',product_tmpl_id)]" groups="product.group_stock_packaging"/>
<field name="product_purchase_qty"/>
<field name="product_purchase_uom_id" groups="product.group_uom"/>
</label>
<field name="product_uom" position="attributes">
<attribute name="attrs">{'readonly' : [('packaging_id', '!=', False)]}</attribute>
</field>
</data>
</field>
</record>
</data>
</openerp>