From 421a5b3ce5cced5193bd299693ab2f2f2aabd538 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Wed, 1 Apr 2015 14:59:17 +0200 Subject: [PATCH] [IMP] stock: two different reports for picking with move lines and picking with pack operations instead of one It is confusing to show once pack operations and once move lines without the user being aware. As sometimes the pack operations don't get updated the report would not show all the products available for example. --- addons/stock/__openerp__.py | 1 + addons/stock/static/src/js/widgets.js | 11 +- addons/stock/stock.py | 4 + addons/stock/stock_report.xml | 8 ++ addons/stock/views/report_stockpicking.xml | 42 +----- .../views/report_stockpicking_operations.xml | 120 ++++++++++++++++++ 6 files changed, 138 insertions(+), 48 deletions(-) create mode 100644 addons/stock/views/report_stockpicking_operations.xml diff --git a/addons/stock/__openerp__.py b/addons/stock/__openerp__.py index 5d1b7c6fa2b..7a1f490c250 100644 --- a/addons/stock/__openerp__.py +++ b/addons/stock/__openerp__.py @@ -88,6 +88,7 @@ Dashboard / Reports for Warehouse Management will include: 'views/report_lot_barcode.xml', 'views/report_location_barcode.xml', 'views/report_stockpicking.xml', + 'views/report_stockpicking_operations.xml', 'views/report_stockinventory.xml', 'views/stock.xml', 'report/report_stock_forecast.xml', diff --git a/addons/stock/static/src/js/widgets.js b/addons/stock/static/src/js/widgets.js index 780af62b774..3126911a677 100644 --- a/addons/stock/static/src/js/widgets.js +++ b/addons/stock/static/src/js/widgets.js @@ -940,13 +940,10 @@ function openerp_picking_widgets(instance){ }, print_picking: function(){ var self = this; - return new instance.web.Model('stock.picking.type').call('read', [[self.picking_type_id], ['code'], new instance.web.CompoundContext()]) - .then(function(pick_type){ - return new instance.web.Model('stock.picking').call('do_print_picking',[[self.picking.id]]) - .then(function(action){ - return self.do_action(action); - }); - }); + return new instance.web.Model('stock.picking').call('do_print_picking_operations',[[self.picking.id]]) + .then(function(action){ + return self.do_action(action); + }); }, picking_next: function(){ for(var i = 0; i < this.pickings.length; i++){ diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 00807be8022..6711ed40f9d 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -871,6 +871,10 @@ class stock_picking(osv.osv): context = dict(context or {}, active_ids=ids) return self.pool.get("report").get_action(cr, uid, ids, 'stock.report_picking', context=context) + def do_print_picking_operations(self, cr, uid, ids, context=None): + '''This function prints the picking list with the pack operations and should be used in the bar code interface''' + context = dict(context or {}, active_ids=ids) + return self.pool.get("report").get_action(cr, uid, ids, 'stock.report_picking_operations', context=context) def action_confirm(self, cr, uid, ids, context=None): todo = [] diff --git a/addons/stock/stock_report.xml b/addons/stock/stock_report.xml index a54b9146baa..3ad03f6dcc3 100644 --- a/addons/stock/stock_report.xml +++ b/addons/stock/stock_report.xml @@ -10,6 +10,14 @@ name="stock.report_picking" file="stock.report_picking" /> +

- +
@@ -104,46 +104,6 @@
Product
- - - - - - - - - - - - - - - - - - - - -
ProductQuantitySourceBarcodeDestination
- - : - - : - - - - - - - - - - - - - : - -
diff --git a/addons/stock/views/report_stockpicking_operations.xml b/addons/stock/views/report_stockpicking_operations.xml new file mode 100644 index 00000000000..43889136cc6 --- /dev/null +++ b/addons/stock/views/report_stockpicking_operations.xml @@ -0,0 +1,120 @@ + + + + + +