summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorArnold Moyaux <arm@odoo.com>2019-05-31 09:15:26 +0000
committerWilliam Henrotin <whe@odoo.com>2019-06-11 12:44:14 +0000
commit36b976cceeeb65fe44bf982f1c110747543d8d32 (patch)
tree3c3bb1be8c5cc8ed0f2e5e7b7e9b3220a40856fe /addons
parenta8f64e6e22a2583a4d038e0fde032960cb65a58e (diff)
[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
Diffstat (limited to 'addons')
-rw-r--r--addons/mrp/report/mrp_report_bom_structure.py4
-rw-r--r--addons/mrp/static/src/js/mrp_bom_report.js7
2 files changed, 6 insertions, 5 deletions
diff --git a/addons/mrp/report/mrp_report_bom_structure.py b/addons/mrp/report/mrp_report_bom_structure.py
index b67583361ca..49fba3b59fc 100644
--- a/addons/mrp/report/mrp_report_bom_structure.py
+++ b/addons/mrp/report/mrp_report_bom_structure.py
@@ -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)
diff --git a/addons/mrp/static/src/js/mrp_bom_report.js b/addons/mrp/static/src/js/mrp_bom_report.js
index 9a359ea2b79..767622feb92 100644
--- a/addons/mrp/static/src/js/mrp_bom_report.js
+++ b/addons/mrp/static/src/js/mrp_bom_report.js
@@ -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;