[IMP] stock: picking and ml views improvements.
commit 0a960c08757a8ba5e1dc1dd36c17a35de8913975 introduced change about reserved quantity that set it to 0 once the move is done. This commit add views improvement. If the move lines are done reserved quantity does not really matter and thus it is better to not display it. Modify the decorator on stock picking that change the font to red if the quantity processed is greater than the reserved quantity. This decorator does not trigger if the picking is in state done since reserved quantity is always 0.
This commit is contained in:
@@ -436,6 +436,7 @@ class StockMove(models.Model):
|
||||
show_source_location=self.location_id.child_ids,
|
||||
show_destination_location=self.location_dest_id.child_ids,
|
||||
show_package=not self.location_id.usage == 'supplier',
|
||||
show_reserved_quantity=self.state != 'done'
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@
|
||||
<field name="package_id" invisible="not context.get('show_package')" groups="stock.group_tracking_lot"/>
|
||||
<field name="result_package_id" groups="stock.group_tracking_lot"/>
|
||||
<field name="owner_id" groups="stock.group_tracking_owner"/>
|
||||
<field name="product_uom_qty" readonly="1"/>
|
||||
<field name="product_uom_qty" invisible="not context.get('show_reserved_quantity')" readonly="1"/>
|
||||
<field name="qty_done"/>
|
||||
<field name="product_uom_id" options="{'no_open': True, 'no_create': True}" attrs="{'readonly': [('product_uom_qty', '!=', 0.0)]}" string="Unit of Measure" groups="product.group_uom"/>
|
||||
</tree>
|
||||
|
||||
@@ -277,7 +277,7 @@
|
||||
<page string="Operations">
|
||||
<field name="id" invisible="1"/>
|
||||
<field name="move_lines" attrs="{'readonly': [('state', 'in', ('cancel', 'done'))]}" context="{'default_picking_id': id, 'form_view_ref':'stock.view_move_picking_form', 'address_in_id': partner_id, 'default_picking_type_id': picking_type_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id}">
|
||||
<tree decoration-danger="quantity_done > reserved_availability" decoration-muted="scrapped == True" string="Stock Moves" editable="bottom">
|
||||
<tree decoration-danger="state != 'done' and quantity_done > reserved_availability" decoration-muted="scrapped == True" string="Stock Moves" editable="bottom">
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="date_expected" invisible="1"/>
|
||||
<field name="state" invisible="1" readonly="0"/>
|
||||
|
||||
Reference in New Issue
Block a user