diff options
| author | Rémy Voet (ryv) <ryv@odoo.com> | 2021-02-01 12:21:03 +0000 |
|---|---|---|
| committer | Rémy Voet (ryv) <ryv@odoo.com> | 2021-03-04 15:02:57 +0000 |
| commit | d43e9cb9ad8d1c0c020209de0e8f6ffdcbc960a1 (patch) | |
| tree | de31a293459aba845ab832ea8fa17afe5db5531b | |
| parent | 9d9f4dea26f3203dd93aefe734ab86503260e219 (diff) | |
[FIX] stock: fix `_get_matching_bom`
The`picking_type_id` of the stock.rule wasn't take in account in
the search of BoM because the `_get_matching_bom` with a empty `self`.
fix it by call on the current rule.
| -rw-r--r-- | addons/mrp/models/stock_rule.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mrp/models/stock_rule.py b/addons/mrp/models/stock_rule.py index 24d1c4f16c2..fa733a51776 100644 --- a/addons/mrp/models/stock_rule.py +++ b/addons/mrp/models/stock_rule.py @@ -41,7 +41,7 @@ class StockRule(models.Model): productions_values_by_company = defaultdict(list) errors = [] for procurement, rule in procurements: - bom = self._get_matching_bom(procurement.product_id, procurement.company_id, procurement.values) + bom = rule._get_matching_bom(procurement.product_id, procurement.company_id, procurement.values) if not bom: msg = _('There is no Bill of Material of type manufacture or kit found for the product %s. Please define a Bill of Material for this product.') % (procurement.product_id.display_name,) errors.append((procurement, msg)) |
