mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP] mrp_multi_level: show main supplier in mrp inventory
This commit is contained in:
@@ -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,12 @@ 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,
|
||||
)
|
||||
|
||||
def _compute_uom_id(self):
|
||||
for rec in self:
|
||||
|
||||
@@ -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>
|
||||
@@ -57,6 +61,7 @@
|
||||
attrs="{'invisible':[('to_procure','<=',0.0)]}"
|
||||
/>
|
||||
<field name="supply_method" />
|
||||
<field name="main_supplier_id" optional="hide" />
|
||||
<field name="running_availability" />
|
||||
</tree>
|
||||
</field>
|
||||
@@ -118,6 +123,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"
|
||||
|
||||
Reference in New Issue
Block a user