diff options
| author | William Henrotin <whe@odoo.com> | 2019-05-07 07:41:16 +0000 |
|---|---|---|
| committer | William Henrotin <whe@odoo.com> | 2019-05-08 08:03:36 +0000 |
| commit | ca35f98c7fbca40f1daebd05b8f1e25dc019e890 (patch) | |
| tree | 54965e8598096d6f266a3706a949110676a1278b /addons | |
| parent | e28cc1775d9d6df65b209874896c84b6fcab4e8d (diff) | |
[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
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/stock/models/stock_move.py | 2 | ||||
| -rw-r--r-- | addons/stock/models/stock_move_line.py | 1 | ||||
| -rw-r--r-- | addons/stock/views/stock_move_views.xml | 3 | ||||
| -rw-r--r-- | addons/stock/views/stock_picking_views.xml | 4 |
4 files changed, 6 insertions, 4 deletions
diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py index c2492c3a572..1595ef7c5cc 100644 --- a/addons/stock/models/stock_move.py +++ b/addons/stock/models/stock_move.py @@ -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' ), } diff --git a/addons/stock/models/stock_move_line.py b/addons/stock/models/stock_move_line.py index 7e04f92085e..3e37b6b670b 100644 --- a/addons/stock/models/stock_move_line.py +++ b/addons/stock/models/stock_move_line.py @@ -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) diff --git a/addons/stock/views/stock_move_views.xml b/addons/stock/views/stock_move_views.xml index b80ffcac730..e3a2d5674c4 100644 --- a/addons/stock/views/stock_move_views.xml +++ b/addons/stock/views/stock_move_views.xml @@ -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> diff --git a/addons/stock/views/stock_picking_views.xml b/addons/stock/views/stock_picking_views.xml index 7d3eb2d998d..1a2d1f37cea 100644 --- a/addons/stock/views/stock_picking_views.xml +++ b/addons/stock/views/stock_picking_views.xml @@ -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> |
