mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
* readonly state for secondary_unit values follow product_uom_id and product_uom_qty
This commit is contained in:
@@ -10,10 +10,11 @@
|
||||
<field name="groups_id" eval="[(4, ref('uom.group_uom'))]"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="product_uom_qty" position="before">
|
||||
<field name="secondary_uom_qty"/>
|
||||
<field name="secondary_uom_qty" readonly="1"/>
|
||||
<field name="secondary_uom_id"
|
||||
domain="[('product_tmpl_id.product_variant_ids', 'in', [product_id])]"
|
||||
options="{'no_create': True}"/>
|
||||
attrs="{'readonly': ['|', ('product_uom_qty', '!=', 0.0), '&', ('package_level_id', '!=', False), ('parent.picking_type_entire_packs', '=', True)]}"
|
||||
domain="[('product_tmpl_id.product_variant_ids', 'in', [product_id])]"
|
||||
options="{'no_create': True}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -10,14 +10,18 @@
|
||||
<field name="groups_id" eval="[(4, ref('uom.group_uom'))]"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='move_ids_without_package']/tree/field[@name='product_uom_qty']" position="before">
|
||||
<field name="secondary_uom_qty"/>
|
||||
<field name="secondary_uom_qty"
|
||||
attrs="{'column_invisible': ['&',('parent.immediate_transfer', '=', True), ('parent.is_locked', '=', True)], 'readonly': [('is_initial_demand_editable', '=', False)]}" />
|
||||
<field name="secondary_uom_id"
|
||||
attrs="{'readonly': [('state', '!=', 'draft'), ('additional', '=', False)]}"
|
||||
domain="[('product_tmpl_id.product_variant_ids', 'in', [product_id])]"
|
||||
options="{'no_create': True}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='move_line_ids_without_package']/tree/field[@name='product_uom_qty']" position="before">
|
||||
<field name="secondary_uom_qty"/>
|
||||
<field name="secondary_uom_qty" readonly="1" />
|
||||
<field name="secondary_uom_id"
|
||||
force_save="1"
|
||||
attrs="{'readonly': [('state', '!=', 'draft')]}"
|
||||
domain="[('product_tmpl_id.product_variant_ids', 'in', [product_id])]"
|
||||
options="{'no_create': True}"/>
|
||||
</xpath>
|
||||
|
||||
Reference in New Issue
Block a user