Skip to content
Browse files

[FIX] mrp: Printing a BOM with a variant

Steps to reproduce the bug:
- Create a BOM for product P
- Generate variants for P: P1 and P2
- Go to BOM of P and click on Structure & Cost
- Change the current variant to P2
- Click on "Print"


A traceback was raised because the function _get_bom expects in arguments that
product_id is an id and not a recordset.

  • Loading branch information...
simongoffin committed Mar 26, 2019
1 parent b8950ab commit 2b62730c31a8d39495eaa456d210072878c7d588
Showing with 2 additions and 2 deletions.
  1. +2 −2 addons/mrp/report/
@@ -208,10 +208,10 @@ def _get_price(self, bom, factor, product):

def _get_pdf_line(self, bom_id, product_id=False, qty=1, child_bom_ids=[], unfolded=False):

data = self._get_bom(bom_id=bom_id, product_id=product_id, line_qty=qty)
data = self._get_bom(bom_id=bom_id,, line_qty=qty)

def get_sub_lines(bom, product_id, line_qty, line_id, level):
data = self._get_bom(, product_id=product_id, line_qty=line_qty, line_id=line_id, level=level)
data = self._get_bom(,, line_qty=line_qty, line_id=line_id, level=level)
bom_lines = data['components']
lines = []
for bom_line in bom_lines:

0 comments on commit 2b62730

Please sign in to comment.
You can’t perform that action at this time.