mrp_packaging_qty/views/mrp_production_views.xml

30 lines
1.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="mrp_production_form_view_inherit_packaging" model="ir.ui.view">
<field name="name">mrp.production.form.inherit.packaging</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="arch" type="xml">
<xpath expr="//label[@for='product_qty']" position="attributes">
<attribute name="invisible">packaging_id</attribute>
</xpath>
<xpath expr="//div[@name='qty']" position="attributes">
<attribute name="invisible">packaging_id</attribute>
</xpath>
<xpath expr="//div[@name='qty']" position="after">
<field name="packaging_id" placeholder="Packaging" invisible="packaging_id" readonly="state in ('done', 'cancel')"/>
<label for="packaging_qty" string="Quantity" invisible="not packaging_id"/>
<div class="o_row g-0 d-flex" name="qty_packaging" invisible="not packaging_id">
<div invisible="state == 'draft'" class="o_row flex-grow-1">
<field name="qty_producing_packaging" class="text-start text-truncate" readonly="state == 'cancel' or (state == 'done' and is_locked)" force_save="1"/>
/
</div>
<field name="packaging_qty" class="oe_inline text-start text-truncate" readonly="state != 'draft'" force_save="1" style="width:auto!important"/>
<field name="packaging_id" options="{'no_open': True, 'no_create': True}" readonly="state in ('done', 'cancel')" class="oe_inline" style="width:auto!important"/>
<span name="to_produce_pkg" class='fw-bold text-nowrap'>To Produce</span>
</div>
</xpath>
</field>
</record>
</odoo>