Skip to content
Snippets Groups Projects
Commit 63167ac8 authored by mreficent's avatar mreficent Committed by William Henrotin
Browse files

[FIX] stock,mrp: don't unarchive operations from archived warehouses


If you modify an archived warehouse, it may happen that the associated operations get unarchived. Operations should be active only if their warehouse is active.

closes odoo/odoo#70553

X-original-commit: ad9a5761
Signed-off-by: default avatarWilliam Henrotin <Whenrow@users.noreply.github.com>
parent 811f4297
No related branches found
No related tags found
No related merge requests found
......@@ -259,15 +259,15 @@ class StockWarehouse(models.Model):
data = super(StockWarehouse, self)._get_picking_type_update_values()
data.update({
'pbm_type_id': {
'active': self.manufacture_to_resupply and self.manufacture_steps in ('pbm', 'pbm_sam'),
'active': self.manufacture_to_resupply and self.manufacture_steps in ('pbm', 'pbm_sam') and self.active,
'barcode': self.code.replace(" ", "").upper() + "-PC",
},
'sam_type_id': {
'active': self.manufacture_to_resupply and self.manufacture_steps == 'pbm_sam',
'active': self.manufacture_to_resupply and self.manufacture_steps == 'pbm_sam' and self.active,
'barcode': self.code.replace(" ", "").upper() + "-SFP",
},
'manu_type_id': {
'active': self.manufacture_to_resupply,
'active': self.manufacture_to_resupply and self.active,
'default_location_src_id': self.manufacture_steps in ('pbm', 'pbm_sam') and self.pbm_loc_id.id or self.lot_stock_id.id,
'default_location_dest_id': self.manufacture_steps == 'pbm_sam' and self.sam_loc_id.id or self.lot_stock_id.id,
},
......
......@@ -909,12 +909,12 @@ class Warehouse(models.Model):
'barcode': self.code.replace(" ", "").upper() + "-DELIVERY",
},
'pick_type_id': {
'active': self.delivery_steps != 'ship_only',
'active': self.delivery_steps != 'ship_only' and self.active,
'default_location_dest_id': output_loc.id if self.delivery_steps == 'pick_ship' else self.wh_pack_stock_loc_id.id,
'barcode': self.code.replace(" ", "").upper() + "-PICK",
},
'pack_type_id': {
'active': self.delivery_steps == 'pick_pack_ship',
'active': self.delivery_steps == 'pick_pack_ship' and self.active,
'barcode': self.code.replace(" ", "").upper() + "-PACK",
},
'int_type_id': {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment