mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[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:
@@ -75,6 +75,11 @@ class MrpInventory(models.Model):
|
|||||||
readonly=True,
|
readonly=True,
|
||||||
store=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):
|
def _compute_uom_id(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
|
|||||||
@@ -77,6 +77,11 @@ class MrpPlannedOrder(models.Model):
|
|||||||
"mrp.production", "planned_order_id", string="Manufacturing Orders"
|
"mrp.production", "planned_order_id", string="Manufacturing Orders"
|
||||||
)
|
)
|
||||||
mo_count = fields.Integer(compute="_compute_mrp_production_count")
|
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):
|
def _compute_mrp_production_count(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ class ProductMRPArea(models.Model):
|
|||||||
inverse_name="product_mrp_area_id",
|
inverse_name="product_mrp_area_id",
|
||||||
readonly=True,
|
readonly=True,
|
||||||
)
|
)
|
||||||
|
mrp_planner_id = fields.Many2one("res.users")
|
||||||
|
|
||||||
_sql_constraints = [
|
_sql_constraints = [
|
||||||
(
|
(
|
||||||
|
|||||||
@@ -108,6 +108,12 @@
|
|||||||
<field name="company_id" groups="base.group_multi_company" />
|
<field name="company_id" groups="base.group_multi_company" />
|
||||||
</group>
|
</group>
|
||||||
<separator />
|
<separator />
|
||||||
|
<field name="mrp_planner_id" invisible="1" />
|
||||||
|
<filter
|
||||||
|
string="My products"
|
||||||
|
name="mrp_planner_id"
|
||||||
|
domain="[('mrp_planner_id', '=', uid)]"
|
||||||
|
/>
|
||||||
<filter
|
<filter
|
||||||
string="To Procure"
|
string="To Procure"
|
||||||
name="filter_to_procure"
|
name="filter_to_procure"
|
||||||
|
|||||||
@@ -83,6 +83,11 @@
|
|||||||
<field name="product_id" />
|
<field name="product_id" />
|
||||||
<field name="mrp_area_id" />
|
<field name="mrp_area_id" />
|
||||||
<separator />
|
<separator />
|
||||||
|
<filter
|
||||||
|
string="My products"
|
||||||
|
name="mrp_planner_id"
|
||||||
|
domain="[('mrp_planner_id', '=', uid)]"
|
||||||
|
/>
|
||||||
<filter string="Fixed" name="fixed" domain="[('fixed','=',True)]" />
|
<filter string="Fixed" name="fixed" domain="[('fixed','=',True)]" />
|
||||||
<group name='group_by' expand="0" string="Group By...">
|
<group name='group_by' expand="0" string="Group By...">
|
||||||
<filter
|
<filter
|
||||||
|
|||||||
@@ -63,6 +63,7 @@
|
|||||||
/>
|
/>
|
||||||
<field name="product_tmpl_id" invisible="1" />
|
<field name="product_tmpl_id" invisible="1" />
|
||||||
<field name="product_id" />
|
<field name="product_id" />
|
||||||
|
<field name="mrp_planner_id" />
|
||||||
<field name="location_id" invisible="1" />
|
<field name="location_id" invisible="1" />
|
||||||
<field
|
<field
|
||||||
name="location_proc_id"
|
name="location_proc_id"
|
||||||
@@ -155,6 +156,12 @@
|
|||||||
name="inactive"
|
name="inactive"
|
||||||
domain="[('active','=',False)]"
|
domain="[('active','=',False)]"
|
||||||
/>
|
/>
|
||||||
|
<separator />
|
||||||
|
<filter
|
||||||
|
string="My products"
|
||||||
|
name="mrp_planner_id"
|
||||||
|
domain="[('mrp_planner_id', '=', uid)]"
|
||||||
|
/>
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
Reference in New Issue
Block a user