[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
parent ba69b7c07a
commit d5778e1b58
6 changed files with 29 additions and 0 deletions

View File

@@ -75,6 +75,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

@@ -77,6 +77,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 = [
(

View File

@@ -108,6 +108,12 @@
<field name="company_id" groups="base.group_multi_company" />
</group>
<separator />
<field name="mrp_planner_id" invisible="1" />
<filter
string="My products"
name="mrp_planner_id"
domain="[('mrp_planner_id', '=', uid)]"
/>
<filter
string="To Procure"
name="filter_to_procure"

View File

@@ -83,6 +83,11 @@
<field name="product_id" />
<field name="mrp_area_id" />
<separator />
<filter
string="My products"
name="mrp_planner_id"
domain="[('mrp_planner_id', '=', uid)]"
/>
<filter string="Fixed" name="fixed" domain="[('fixed','=',True)]" />
<group name='group_by' expand="0" string="Group By...">
<filter

View File

@@ -63,6 +63,7 @@
/>
<field name="product_tmpl_id" invisible="1" />
<field name="product_id" />
<field name="mrp_planner_id" />
<field name="location_id" invisible="1" />
<field
name="location_proc_id"
@@ -155,6 +156,12 @@
name="inactive"
domain="[('active','=',False)]"
/>
<separator />
<filter
string="My products"
name="mrp_planner_id"
domain="[('mrp_planner_id', '=', uid)]"
/>
</search>
</field>
</record>