[IMP] stock: hide 'reserved quantity' column in receipt
A reception don't need any reservation. The column 'Reserved Quantity' on picking are so useless Task: 1940358
This commit is contained in:
@@ -471,7 +471,7 @@ class StockMove(models.Model):
|
||||
show_source_location=self.location_id.child_ids and self.picking_type_id.code != 'incoming',
|
||||
show_destination_location=self.location_dest_id.child_ids and self.picking_type_id.code != 'outgoing',
|
||||
show_package=not self.location_id.usage == 'supplier',
|
||||
show_reserved_quantity=self.state != 'done' and not self.picking_id.immediate_transfer
|
||||
show_reserved_quantity=self.state != 'done' and not self.picking_id.immediate_transfer and self.picking_type_id.code != 'incoming'
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ class StockMoveLine(models.Model):
|
||||
location_id = fields.Many2one('stock.location', 'From', required=True)
|
||||
location_dest_id = fields.Many2one('stock.location', 'To', required=True)
|
||||
lots_visible = fields.Boolean(compute='_compute_lots_visible')
|
||||
picking_code = fields.Selection(related='picking_id.picking_type_id.code', readonly=True)
|
||||
picking_type_use_create_lots = fields.Boolean(related='picking_id.picking_type_id.use_create_lots', readonly=True)
|
||||
picking_type_use_existing_lots = fields.Boolean(related='picking_id.picking_type_id.use_existing_lots', readonly=True)
|
||||
state = fields.Selection(related='move_id.state', store=True, related_sudo=False, readonly=False)
|
||||
|
||||
@@ -172,7 +172,7 @@
|
||||
<field name="model">stock.move.line</field>
|
||||
<field name="priority">1000</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree editable="bottom" decoration-muted="state == 'done' and is_locked == True" decoration-success="product_uom_qty==qty_done" decoration-danger="qty_done > product_uom_qty and state != 'done'">
|
||||
<tree editable="bottom" decoration-muted="state == 'done' and is_locked == True" decoration-success="product_uom_qty==qty_done" decoration-danger="qty_done > product_uom_qty and state != 'done' and self.picking_type_id.code != 'incoming'">
|
||||
<field name="picking_id" invisible="1"/>
|
||||
<field name="product_id" invisible="1"/>
|
||||
<field name="package_level_id" invisible="1"/>
|
||||
@@ -187,6 +187,7 @@
|
||||
<field name="product_uom_qty" invisible="not context.get('show_reserved_quantity')" readonly="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="is_locked" invisible="1"/>
|
||||
<field name="picking_code" invisible="1"/>
|
||||
<field name="qty_done" attrs="{'readonly': ['|', '|', ('is_initial_demand_editable', '=', True), '&', ('state', '=', 'done'), ('is_locked', '=', True), '&', ('package_level_id', '!=', False), ('parent.picking_type_entire_packs', '=', True)]}"/>
|
||||
<field name="product_uom_id" options="{'no_open': True, 'no_create': True}" attrs="{'readonly': ['|', ('product_uom_qty', '!=', 0.0), '&', ('package_level_id', '!=', False), ('parent.picking_type_entire_packs', '=', True)]}" string="Unit of Measure" groups="uom.group_uom"/>
|
||||
</tree>
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
<notebook>
|
||||
<page string="Detailed Operations" attrs="{'invisible': [('show_operations', '=', False)]}">
|
||||
<field name="move_line_ids_without_package" attrs="{'readonly': ['|', '|', ('show_operations', '=', False), ('state', '=', 'cancel'), '&', ('state', '=', 'done'), ('is_locked', '=', True)]}" context="{'default_picking_id': id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id}">
|
||||
<tree editable="bottom" decoration-muted="(state == 'done' and is_locked == True)" decoration-danger="qty_done>product_uom_qty and state!='done'" decoration-success="qty_done==product_uom_qty and state!='done' and not result_package_id">
|
||||
<tree editable="bottom" decoration-muted="(state == 'done' and is_locked == True)" decoration-danger="qty_done>product_uom_qty and state!='done' and self.picking_type_id.code != 'incoming'" decoration-success="qty_done==product_uom_qty and state!='done' and not result_package_id">
|
||||
<field name="product_id" required="1" attrs="{'readonly': ['|', ('state', '=', 'done'), ('move_id', '!=', False)]}"/>
|
||||
<field name="move_id" invisible="1"/>
|
||||
<field name="product_uom_id" force_save="1" attrs="{'readonly': [('state', '!=', 'draft')]}" groups="uom.group_uom"/>
|
||||
@@ -282,7 +282,7 @@
|
||||
<field name="lot_id" groups="stock.group_production_lot" attrs="{'column_invisible': [('parent.show_lots_text', '=', True)], 'invisible': [('lots_visible', '=', False)]}" domain="[('product_id', '=', product_id)]" context="{'default_product_id': product_id}"/>
|
||||
<field name="lot_name" groups="stock.group_production_lot" attrs="{'column_invisible': [('parent.show_lots_text', '=', False)], 'invisible': [('lots_visible', '=', False)]}" context="{'default_product_id': product_id}"/>
|
||||
<field name="is_initial_demand_editable" invisible="1"/>
|
||||
<field name="product_uom_qty" readonly="1" attrs="{'column_invisible': [('parent.immediate_transfer', '=', True)]}"/>
|
||||
<field name="product_uom_qty" readonly="1" attrs="{'column_invisible': ['|',('parent.immediate_transfer', '=', True),('parent.picking_type_code','=','incoming')]}"/>
|
||||
<field name="is_locked" invisible="1"/>
|
||||
<field name="qty_done" attrs="{'readonly': [('state', 'in', ('done', 'cancel')), ('is_locked', '=', True)]}" force_save="1"/>
|
||||
</tree>
|
||||
|
||||
Reference in New Issue
Block a user