[FIX] stock: hide detailed operation in draft

The draft state should only allows setting the initial demand
This commit also allow editing the reserve quantity at the move line
creation

closes odoo/odoo#122445

Task: 3256447
Related: odoo/enterprise#41548
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This commit is contained in:
William Henrotin
2023-05-30 13:03:20 +02:00
parent e650d20e4d
commit 6e23e879f9
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -248,6 +248,7 @@ class StockMove(models.Model):
else:
move.show_details_visible = (((consignment_enabled and move.picking_code != 'incoming') or
show_details_visible or move.has_tracking != 'none') and
move.state != 'draft' and
move.show_operations is False)
def _compute_show_reserved_availability(self):
+1 -1
View File
@@ -253,7 +253,7 @@
<field name="package_id" attrs="{'readonly': ['&amp;', ('package_level_id', '!=', False), ('parent.picking_type_entire_packs', '=', True)]}" invisible="not context.get('show_package')" groups="stock.group_tracking_lot"/>
<field name="result_package_id" attrs="{'readonly': ['&amp;', ('package_level_id', '!=', False), ('parent.picking_type_entire_packs', '=', True)]}" groups="stock.group_tracking_lot" context="{'picking_id': picking_id}"/>
<field name="owner_id" attrs="{'readonly': ['&amp;', ('package_level_id', '!=', False), ('parent.picking_type_entire_packs', '=', True)]}" invisible="not context.get('show_owner')" groups="stock.group_tracking_owner"/>
<field name="reserved_uom_qty" attrs="{'readonly': [('id', '=', False)]}" invisible="not context.get('show_reserved_quantity')"/>
<field name="reserved_uom_qty" invisible="not context.get('show_reserved_quantity')"/>
<field name="state" invisible="1"/>
<field name="is_locked" invisible="1"/>
<field name="picking_code" invisible="1"/>