mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[13.0][FIX] mrp_multi_level:
* main supplier computation in multi company * triplicated field in search view
This commit is contained in:
@@ -157,8 +157,7 @@ class ProductMRPArea(models.Model):
|
||||
proc_loc = rec.location_proc_id or rec.mrp_area_id.location_id
|
||||
values = {
|
||||
"warehouse_id": rec.mrp_area_id.warehouse_id,
|
||||
"company_id": self.env.user.company_id.id,
|
||||
# TODO: better way to get company
|
||||
"company_id": self.env.company,
|
||||
}
|
||||
rule = group_obj._get_rule(rec.product_id, proc_loc, values)
|
||||
rec.supply_method = rule.action if rule else "none"
|
||||
@@ -169,6 +168,7 @@ class ProductMRPArea(models.Model):
|
||||
for rec in self.filtered(lambda r: r.supply_method == "buy"):
|
||||
suppliers = rec.product_id.seller_ids.filtered(
|
||||
lambda r: (not r.product_id or r.product_id == rec.product_id)
|
||||
and (not r.company_id or r.company_id == rec.company_id)
|
||||
)
|
||||
if not suppliers:
|
||||
continue
|
||||
|
||||
@@ -108,15 +108,9 @@
|
||||
<filter name="group_supply_method"
|
||||
string="Supply Method"
|
||||
context="{'group_by':'supply_method'}"/>
|
||||
<filter name="group_release_date_day"
|
||||
string="Date to Procure (By Day)"
|
||||
context="{'group_by':'order_release_date:day'}"/>
|
||||
<filter name="group_release_date_week"
|
||||
string="Date to Procure (By Week)"
|
||||
context="{'group_by':'order_release_date:week'}"/>
|
||||
<filter name="group_release_date_month"
|
||||
string="Date to Procure (By Month)"
|
||||
context="{'group_by':'order_release_date:month'}"/>
|
||||
<filter name="group_release_date"
|
||||
string="Date to Procure"
|
||||
context="{'group_by':'order_release_date'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user