[FIX] mrp: display all information for pdf

mrp_plm in OE uses the child_bom and prod_id from lines obtains
by _get_pdf_line in the case of a pdf report. It was already pass
by _get_bom_lines with the html report. It implies that the pdf and
html report could be different.

Task : 1939278
Closes #32340
This commit is contained in:
Arnold Moyaux
2019-06-11 12:44:14 +00:00
committed by William Henrotin
parent a8f64e6e22
commit 36b976ccee
2 changed files with 6 additions and 5 deletions
@@ -20,7 +20,7 @@ class ReportBomStructure(models.AbstractModel):
if data and data.get('childs'):
doc = self._get_pdf_line(bom_id, product_id=product_variant_id, qty=float(data.get('quantity')), child_bom_ids=json.loads(data.get('childs')))
else:
doc = self._get_pdf_line(bom_id, product_id=product_variant_id, unfolded=True)
doc = self._get_pdf_line(bom_id, product_id=product_variant_id, qty=float(data.get('quantity')), unfolded=True)
doc['report_type'] = 'pdf'
doc['report_structure'] = data and data.get('report_type') or 'all'
docs.append(doc)
@@ -28,7 +28,7 @@ class ReportBomStructure(models.AbstractModel):
if data and data.get('childs'):
doc = self._get_pdf_line(bom_id, qty=float(data.get('quantity')), child_bom_ids=json.loads(data.get('childs')))
else:
doc = self._get_pdf_line(bom_id, unfolded=True)
doc = self._get_pdf_line(bom_id, qty=float(data.get('quantity')), unfolded=True)
doc['report_type'] = 'pdf'
doc['report_structure'] = data and data.get('report_type') or 'all'
docs.append(doc)
+4 -3
View File
@@ -120,10 +120,11 @@ var MrpBomReport = stock_report_generic.extend({
return $(el).data('id');
});
framework.blockUI();
var reportname = 'mrp.report_bom_structure?docids=' + this.given_context.active_id + '&report_type=' + this.given_context.report_type;
var reportname = 'mrp.report_bom_structure?docids=' + this.given_context.active_id +
'&report_type=' + this.given_context.report_type +
'&quantity=' + (this.given_context.searchQty || 1);
if (! $(ev.currentTarget).hasClass('o_mrp_bom_print_unfolded')) {
reportname += '&quantity=' + (this.given_context.searchQty || 1) +
'&childs=' + JSON.stringify(childBomIDs);
reportname += '&childs=' + JSON.stringify(childBomIDs);
}
if (this.given_context.searchVariant) {
reportname += '&variant=' + this.given_context.searchVariant;