diff --git a/addons/mrp/__manifest__.py b/addons/mrp/__manifest__.py index 08e86466cf4..55d09e1c1de 100644 --- a/addons/mrp/__manifest__.py +++ b/addons/mrp/__manifest__.py @@ -76,7 +76,6 @@ 'mrp/static/src/js/mrp_document_kanban_view.js', 'mrp/static/src/js/mrp_should_consume.js', 'mrp/static/src/js/mrp_field_one2many_with_copy.js', - 'mrp/static/src/js/report_stock_reception.js', ], 'web.qunit_suite_tests': [ 'mrp/static/tests/**/*', diff --git a/addons/mrp/report/mrp_report_views_main.xml b/addons/mrp/report/mrp_report_views_main.xml index 5f947480abd..095d32f8834 100644 --- a/addons/mrp/report/mrp_report_views_main.xml +++ b/addons/mrp/report/mrp_report_views_main.xml @@ -40,6 +40,7 @@ report + Order Label mrp.production diff --git a/addons/mrp/report/report_stock_reception.xml b/addons/mrp/report/report_stock_reception.xml index 1ad4cc4dd47..38e423e05b4 100644 --- a/addons/mrp/report/report_stock_reception.xml +++ b/addons/mrp/report/report_stock_reception.xml @@ -1,6 +1,7 @@ + diff --git a/addons/mrp/static/src/js/report_stock_reception.js b/addons/mrp/static/src/js/report_stock_reception.js deleted file mode 100644 index 5da4a80bf98..00000000000 --- a/addons/mrp/static/src/js/report_stock_reception.js +++ /dev/null @@ -1,16 +0,0 @@ -/** @odoo-module **/ - -import ReceptionReport from '@stock/js/report_stock_reception'; - -ReceptionReport.include({ - - /** - * @override - */ - _onClickPrintLabel: function (ev) { - return this._super(ev).then(() => { - return this._printLabel(ev, 'mrp.report_reception_report_label_mrp', 'mrp.production'); - }); - }, - -}); diff --git a/addons/stock/report/report_stock_reception.xml b/addons/stock/report/report_stock_reception.xml index c11818d9dc6..c1cf62df4ce 100644 --- a/addons/stock/report/report_stock_reception.xml +++ b/addons/stock/report/report_stock_reception.xml @@ -8,15 +8,15 @@ - + - - + + @@ -132,8 +132,7 @@ report - Picking Label - stock.picking + Reception Report Label + stock.move qweb-pdf stock.report_reception_report_label stock.report_reception_report_label - report diff --git a/addons/stock/static/src/js/report_stock_reception.js b/addons/stock/static/src/js/report_stock_reception.js index d27e59fbfc8..d11fb6b5e4e 100644 --- a/addons/stock/static/src/js/report_stock_reception.js +++ b/addons/stock/static/src/js/report_stock_reception.js @@ -99,7 +99,9 @@ const ReceptionReport = clientAction.extend({ nodeToAssign = iframe.querySelectorAll('.o_report_reception_assign:not(.o_assign_all)'); } else { // Local assign all nodeToAssign = el.closest('thead').nextElementSibling.querySelectorAll('.o_report_reception_assign:not(.o_assign_all)'); - el.closest('thead').nextElementSibling.querySelectorAll('.o_print_label_all').forEach(button => button.removeAttribute('disabled')); + const thead = el.closest('thead'); + thead.querySelector('.o_print_label_all').removeAttribute('disabled'); + thead.nextElementSibling.querySelectorAll('.o_print_label_all').forEach(button => button.removeAttribute('disabled')); } } nodeToAssign.forEach(node => { @@ -156,16 +158,10 @@ const ReceptionReport = clientAction.extend({ * Print the corresponding source label */ _onClickPrintLabel: function (ev) { - // unfortunately, due to different reports needed for different models, we will handle - // pickings here and others models will have to be extended/printed separately until better - // technique to merge into continuous pdf to written - return this._printLabel(ev, 'stock.report_reception_report_label', 'stock.picking'); - }, - - _printLabel: function (ev, report_file, sourceModel) { const el = ev.currentTarget; const modelIds = []; const productQtys = []; + const report_file = 'stock.report_reception_report_label'; let nodeToPrint = []; if (el.name === 'print_label') { // One line print @@ -179,10 +175,8 @@ const ReceptionReport = clientAction.extend({ } nodeToPrint.forEach(node => { - if (node.getAttribute('source-model') === sourceModel) { - modelIds.push(parseInt(node.getAttribute('source-id'))); - productQtys.push(Math.ceil(node.getAttribute('qty')) || '1'); - } + modelIds.push(parseInt(node.getAttribute('move-id'))); + productQtys.push(Math.ceil(node.getAttribute('qty')) || '1'); }); if (!modelIds.length) { // Nothing to print for this model. diff --git a/addons/stock/static/src/scss/report_stock_reception.scss b/addons/stock/static/src/scss/report_stock_reception.scss index ccb190f35f6..7f762667e2b 100644 --- a/addons/stock/static/src/scss/report_stock_reception.scss +++ b/addons/stock/static/src/scss/report_stock_reception.scss @@ -38,6 +38,10 @@ font-size:80%; width: 57mm; height: 32mm; + & span, div { + line-height: 1; + white-space: nowrap; + } } span[itemprop="name"] {