[FIX] mrp_bom_cost: cost without BOM
- Activate variants - On a product variant without BOM, go to Action > Compute Price from BOM A zero-division is raised because of `... / bom.product_qty`. opw-2067520 closes odoo/odoo#36733 closes odoo/odoo#36736 closes odoo/odoo#36749 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com> Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com> Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -50,6 +50,8 @@ class ProductProduct(models.Model):
|
||||
|
||||
def _compute_bom_price(self, bom, boms_to_recompute=False):
|
||||
self.ensure_one()
|
||||
if not bom:
|
||||
return 0
|
||||
if not boms_to_recompute:
|
||||
boms_to_recompute = []
|
||||
total = 0
|
||||
|
||||
Reference in New Issue
Block a user