Skip to content
Snippets Groups Projects
Commit 06c17274 authored by Touati Djamel (otd)'s avatar Touati Djamel (otd)
Browse files

[FIX] mrp: fix BOM structure & cost


Steps to reproduce the bug:
- Install manufacturing app
- Create a product “A”
- Create a Bill of Materials for product A > add any product > save
- Create another Product “B” > Create a BOM and add the product “A” in quantity “0” > save
- Click on “BOM Structure & Cost” for product “B” > open the sublevel BOM dropdown of the product “A”

Problem:
An error is triggered because the quantity of the product is "None"

opw-2585033

closes odoo/odoo#73233

Signed-off-by: default avatarAnh Thao PHAM <kitan191@users.noreply.github.com>
parent 3f409c08
Branches
Tags
No related merge requests found
......@@ -96,7 +96,7 @@ class ReportBomStructure(models.AbstractModel):
bom_quantity = line_qty
if line_id:
current_line = self.env['mrp.bom.line'].browse(int(line_id))
bom_quantity = current_line.product_uom_id._compute_quantity(line_qty, bom.product_uom_id)
bom_quantity = current_line.product_uom_id._compute_quantity(line_qty, bom.product_uom_id) or 0
# Display bom components for current selected product variant
if product_id:
product = self.env['product.product'].browse(int(product_id))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment