[IMP] mrp_multi_level: Add MRP Planner

For each MRP Parameter or for each Product in a MRP Area, we will be able to add a MRP Planner. Once this planner is set, he can filter himself in the MRP Parameters view, MRP Inventory view or MRP Planned Orders view.
This commit is contained in:
BernatPForgeFlow
2023-01-30 13:25:32 +01:00
committed by JasminSForgeFlow
parent 3800400d1c
commit d4de93f79a
6 changed files with 29 additions and 0 deletions

View File

@@ -71,6 +71,11 @@ class MrpInventory(models.Model):
readonly=True,
store=True,
)
mrp_planner_id = fields.Many2one(
related="product_mrp_area_id.mrp_planner_id",
readonly=True,
store=True,
)
def _compute_uom_id(self):
for rec in self:

View File

@@ -76,6 +76,11 @@ class MrpPlannedOrder(models.Model):
"mrp.production", "planned_order_id", string="Manufacturing Orders"
)
mo_count = fields.Integer(compute="_compute_mrp_production_count")
mrp_planner_id = fields.Many2one(
related="product_mrp_area_id.mrp_planner_id",
readonly=True,
store=True,
)
def _compute_mrp_production_count(self):
for rec in self:

View File

@@ -97,6 +97,7 @@ class ProductMRPArea(models.Model):
inverse_name="product_mrp_area_id",
readonly=True,
)
mrp_planner_id = fields.Many2one("res.users")
_sql_constraints = [
(