Skip to content

Commit

Permalink
[FIX] mrp_bom_cost: cost without BOM
Browse files Browse the repository at this point in the history
- 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 #36733

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
  • Loading branch information
nim-odoo committed Sep 12, 2019
1 parent 8c15730 commit 87608cd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions addons/mrp_bom_cost/models/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def _get_price_from_bom(self, boms_to_recompute=False):

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
Expand Down

0 comments on commit 87608cd

Please sign in to comment.