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
|
proc_loc = rec.location_proc_id or rec.mrp_area_id.location_id
|
||||||
values = {
|
values = {
|
||||||
"warehouse_id": rec.mrp_area_id.warehouse_id,
|
"warehouse_id": rec.mrp_area_id.warehouse_id,
|
||||||
"company_id": self.env.user.company_id.id,
|
"company_id": self.env.company,
|
||||||
# TODO: better way to get company
|
|
||||||
}
|
}
|
||||||
rule = group_obj._get_rule(rec.product_id, proc_loc, values)
|
rule = group_obj._get_rule(rec.product_id, proc_loc, values)
|
||||||
rec.supply_method = rule.action if rule else "none"
|
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"):
|
for rec in self.filtered(lambda r: r.supply_method == "buy"):
|
||||||
suppliers = rec.product_id.seller_ids.filtered(
|
suppliers = rec.product_id.seller_ids.filtered(
|
||||||
lambda r: (not r.product_id or r.product_id == rec.product_id)
|
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:
|
if not suppliers:
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -108,15 +108,9 @@
|
|||||||
<filter name="group_supply_method"
|
<filter name="group_supply_method"
|
||||||
string="Supply Method"
|
string="Supply Method"
|
||||||
context="{'group_by':'supply_method'}"/>
|
context="{'group_by':'supply_method'}"/>
|
||||||
<filter name="group_release_date_day"
|
<filter name="group_release_date"
|
||||||
string="Date to Procure (By Day)"
|
string="Date to Procure"
|
||||||
context="{'group_by':'order_release_date:day'}"/>
|
context="{'group_by':'order_release_date'}"/>
|
||||||
<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'}"/>
|
|
||||||
</group>
|
</group>
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
Reference in New Issue
Block a user