From fe7b3c66a3459d29eb21e7fe2f14a526c9be4f62 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 28 Mar 2014 11:52:54 +0100 Subject: [PATCH] [FIX] stock_picking_wave: fixed picking wave report bzr revid: qdp-launchpad@openerp.com-20140328105254-0n0jm309n2v4q160 --- addons/report/models/report.py | 1 + addons/report/static/src/js/qwebactionmanager.js | 2 -- addons/stock_picking_wave/__openerp__.py | 1 - addons/stock_picking_wave/stock_picking_wave.py | 12 ++++++++++-- .../stock_picking_wave_reports.xml | 12 ------------ .../stock_picking_wave/stock_picking_wave_view.xml | 2 +- 6 files changed, 12 insertions(+), 18 deletions(-) delete mode 100644 addons/stock_picking_wave/stock_picking_wave_reports.xml diff --git a/addons/report/models/report.py b/addons/report/models/report.py index 8abe8e544eb..d469cf946c5 100644 --- a/addons/report/models/report.py +++ b/addons/report/models/report.py @@ -403,6 +403,7 @@ class Report(osv.Model): 'report_name': report.report_name, 'report_type': report.report_type, 'report_file': report.report_file, + 'context': context, } if datas: diff --git a/addons/report/static/src/js/qwebactionmanager.js b/addons/report/static/src/js/qwebactionmanager.js index b75003942d2..dac8dcacf25 100644 --- a/addons/report/static/src/js/qwebactionmanager.js +++ b/addons/report/static/src/js/qwebactionmanager.js @@ -6,8 +6,6 @@ openerp.report = function(instance) { var self = this; instance.web.blockUI(); action = _.clone(action); - var eval_contexts = ([instance.session.user_context] || []).concat([action.context]); - action.context = instance.web.pyeval.eval('contexts',eval_contexts); _t = instance.web._t; // QWeb reports diff --git a/addons/stock_picking_wave/__openerp__.py b/addons/stock_picking_wave/__openerp__.py index ca64a7141ad..e5882dfcad2 100644 --- a/addons/stock_picking_wave/__openerp__.py +++ b/addons/stock_picking_wave/__openerp__.py @@ -34,7 +34,6 @@ This module adds the picking wave option in warehouse management. 'stock_picking_wave_view.xml', 'stock_picking_wave_sequence.xml', 'wizard/picking_to_wave_view.xml', - 'stock_picking_wave_reports.xml', ], 'demo': [ 'stock_picking_wave_demo.xml', diff --git a/addons/stock_picking_wave/stock_picking_wave.py b/addons/stock_picking_wave/stock_picking_wave.py index 4165a7b8d4f..3fd7d9cdbc0 100644 --- a/addons/stock_picking_wave/stock_picking_wave.py +++ b/addons/stock_picking_wave/stock_picking_wave.py @@ -31,8 +31,16 @@ class stock_picking_wave(osv.osv): ''' This function print the report for all picking_ids associated to the picking wave ''' - context = context or {} - return self.pool.get("report").get_action(cr, uid, ids, 'stock_picking_wave.report_pickingwave', context=context) + if context is None: + context = {} + picking_ids = [] + for wave in self.browse(cr, uid, ids, context=context): + picking_ids += [picking.id for picking in wave.picking_ids] + if not picking_ids: + raise osv.except_osv(_('Error!'), _('Nothing to print.')) + context['active_ids'] = picking_ids + context['active_model'] = 'stock.picking' + return self.pool.get("report").get_action(cr, uid, [], 'stock.report_picking', context=context) def create(self, cr, uid, vals, context=None): if vals.get('name', '/') == '/': diff --git a/addons/stock_picking_wave/stock_picking_wave_reports.xml b/addons/stock_picking_wave/stock_picking_wave_reports.xml deleted file mode 100644 index 76e1d6acbd7..00000000000 --- a/addons/stock_picking_wave/stock_picking_wave_reports.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - diff --git a/addons/stock_picking_wave/stock_picking_wave_view.xml b/addons/stock_picking_wave/stock_picking_wave_view.xml index 450232603e1..2dec7ad4388 100644 --- a/addons/stock_picking_wave/stock_picking_wave_view.xml +++ b/addons/stock_picking_wave/stock_picking_wave_view.xml @@ -13,7 +13,7 @@
-