mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP] mrp_multi_level: Archiving a product should archive related MRP parameters
This commit is contained in:
committed by
JasminSForgeFlow
parent
3f93e09ed9
commit
093bd0d632
@@ -37,6 +37,17 @@ class Product(models.Model):
|
||||
for rec in self:
|
||||
rec.mrp_area_count = len(rec.mrp_area_ids)
|
||||
|
||||
def write(self, values):
|
||||
res = super().write(values)
|
||||
if values.get("active") is False:
|
||||
parameters = (
|
||||
self.env["product.mrp.area"]
|
||||
.sudo()
|
||||
.search([("product_id", "in", self.ids)])
|
||||
)
|
||||
parameters.write({"active": False})
|
||||
return res
|
||||
|
||||
def action_view_mrp_area_parameters(self):
|
||||
self.ensure_one()
|
||||
action = self.env.ref("mrp_multi_level.product_mrp_area_action")
|
||||
|
||||
Reference in New Issue
Block a user