Merge PR #970 into 13.0

Signed-off-by LoisRForgeFlow
This commit is contained in:
OCA-git-bot
2023-02-09 14:51:03 +00:00
6 changed files with 42 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
# © 2016 Ucamco - Wim Audenaert <wim.audenaert@ucamco.com>
# Copyright 2016-19 ForgeFlow S.L. (https://www.forgeflow.com)
# Copyright 2016-21 ForgeFlow S.L. (https://www.forgeflow.com)
# - Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
# - Lois Rilo Antelo <lois.rilo@forgeflow.com>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
@@ -68,6 +68,15 @@ class MrpInventory(models.Model):
readonly=True,
store=True,
)
main_supplier_id = fields.Many2one(
string="Main Supplier",
related="product_mrp_area_id.main_supplier_id",
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,9 @@ 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

@@ -17,6 +17,10 @@
<field name="product_id" />
<field name="product_mrp_area_id" />
<field name="supply_method" />
<field
name="main_supplier_id"
attrs="{'invisible': [('supply_method', '!=', 'buy')]}"
/>
<field name="date" />
</group>
<group>
@@ -64,6 +68,7 @@
/>
<field name="planned_order_ids" invisible="1" />
<field name="supply_method" />
<field name="main_supplier_id" optional="hide" />
<field name="running_availability" />
</tree>
</field>
@@ -103,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"
@@ -125,6 +136,11 @@
string="Supply Method"
context="{'group_by':'supply_method'}"
/>
<filter
name="group_main_supplier_id"
string="Main Supplier"
context="{'group_by':'main_supplier_id'}"
/>
<filter
name="group_release_date"
string="Date 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>