You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

49 lines
2.5 KiB

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Inherit stock scrap form view to add catch weight fields-->
<record id="stock_scrap_form_view" model="ir.ui.view">
<field name="name">stock.scrap.view.form.inherit.cw.stock</field>
<field name="model">stock.scrap</field>
<field name="inherit_id" ref="stock.stock_scrap_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_id']" position="after">
<field name="toggle_cw" invisible="1"/>
<label for="cw_qty" string="CW-Quantity"
attrs="{'invisible':[('toggle_cw', '=', False)],
'required':[('toggle_cw', '=', True)]}"/>
<div class="o_row"
attrs="{'invisible':[('toggle_cw', '=', False)]}">
<field name="cw_qty"
attrs="{'invisible':[('toggle_cw', '=', False)],
'required':[('toggle_cw', '=', True)],
'readonly':[('state', '=', 'done')]}"/>
<field name="category_id" invisible="1"/>
<field name="cw_uom_id"
attrs="{'invisible':[('toggle_cw', '=', False)],
'required':[('toggle_cw', '=', True)]}"/>
</div>
</xpath>
</field>
</record>
<!-- Inherit stock scrap form view to add catch weight fields-->
<record id="stock_scrap_form_view2" model="ir.ui.view">
<field name="name">stock.scrap.view.form.inherit.cw.stock</field>
<field name="model">stock.scrap</field>
<field name="inherit_id" ref="stock.stock_scrap_form_view2"/>
<field name="arch" type="xml">
<xpath expr="//div[hasclass('o_row')]" position="after">
<field name="toggle_cw" invisible="1"/>
<label for="cw_qty" string="CW-Quantity"
attrs="{'invisible':[('toggle_cw', '=', False)]}"/>
<div class="o_row"
attrs="{'invisible':[('toggle_cw', '=', False)]}">
<field name="cw_qty"
attrs="{'required':[('toggle_cw', '=', True)],
'readonly': False}"/>
<field name="category_id" invisible="1"/>
<field name="cw_uom_id" readonly="False"/>
</div>
</xpath>
</field>
</record>
</odoo>