diff --git a/addons/report/models/report.py b/addons/report/models/report.py index 8a2bc21b3b0..cbcbabcde35 100644 --- a/addons/report/models/report.py +++ b/addons/report/models/report.py @@ -239,6 +239,7 @@ class report(osv.Model): action = { 'type': 'ir.actions.report.xml', + 'ids': ids, 'report_name': report.report_name, 'report_type': report.report_type, 'report_file': report.report_file, diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 7f103929a85..133d33e471d 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -787,7 +787,8 @@ class stock_picking(osv.osv): 'model': 'stock.picking', 'ids': ids, } - return {'type': 'ir.actions.report.xml', 'report_name': 'stock.picking.list', 'datas': datas, 'nodestroy': True} + return self.get_action(cr, uid, ids, context=context) + #{'type': 'ir.actions.report.xml', 'report_name': 'stock.picking.list', 'datas': datas, 'nodestroy': True} def do_print_picking(self, cr, uid, ids, context=None): '''This function prints the picking list''' diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index ede38e6058a..5a344536645 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -2145,7 +2145,7 @@ stock.picking form tree,form - [('group_id','=',active_id)] + [('group_id','=',active_id)] procurement.group.form.herited diff --git a/addons/stock_account/wizard/stock_valuation_history_view.xml b/addons/stock_account/wizard/stock_valuation_history_view.xml index ea8b983f13e..83d58133de2 100644 --- a/addons/stock_account/wizard/stock_valuation_history_view.xml +++ b/addons/stock_account/wizard/stock_valuation_history_view.xml @@ -8,7 +8,7 @@

- Choose the date for wich you want to get the stock valuation of your products. + Choose the date for which you want to get the stock valuation of your products. This will filter the stock operation that weren't done at the selected date, to retreive the quantity you had, and gives you the inventory value according to the standard price used at that time. @@ -49,7 +49,7 @@ - + diff --git a/addons/stock_picking_wave/__init__.py b/addons/stock_picking_wave/__init__.py index 59d0d9f72d0..4a3f27b2ebd 100644 --- a/addons/stock_picking_wave/__init__.py +++ b/addons/stock_picking_wave/__init__.py @@ -21,5 +21,6 @@ import stock_picking_wave import wizard +import controllers # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock_picking_wave/__openerp__.py b/addons/stock_picking_wave/__openerp__.py index e5882dfcad2..ca64a7141ad 100644 --- a/addons/stock_picking_wave/__openerp__.py +++ b/addons/stock_picking_wave/__openerp__.py @@ -34,6 +34,7 @@ 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/controllers/__init__.py b/addons/stock_picking_wave/controllers/__init__.py new file mode 100644 index 00000000000..039d9715fab --- /dev/null +++ b/addons/stock_picking_wave/controllers/__init__.py @@ -0,0 +1 @@ +import main \ No newline at end of file diff --git a/addons/stock_picking_wave/controllers/main.py b/addons/stock_picking_wave/controllers/main.py new file mode 100644 index 00000000000..9de14934828 --- /dev/null +++ b/addons/stock_picking_wave/controllers/main.py @@ -0,0 +1,16 @@ +from openerp.addons.web import http +from openerp.addons.web.http import request + + +class picking_wave_report(http.Controller): + @http.route('/report/stock_picking_wave.report_pickingwave/', type='http', auth='user', + website=True, multilang=True) + def report_picking_wave(self, ids): + self.cr, self.uid, self.pool = request.cr, request.uid, request.registry + ids = [int(i) for i in ids.split(',')] + picking_wave_obj = self.pool["stock.picking.wave"] + wave = picking_wave_obj.browse(self.cr, self.uid, ids[0]) + docargs = { + 'docs': wave.picking_ids, + } + return request.registry['report'].render(self.cr, self.uid, [], 'stock.report_picking', docargs) diff --git a/addons/stock_picking_wave/stock_picking_wave.py b/addons/stock_picking_wave/stock_picking_wave.py index c5e3377b023..40c1fa051ed 100644 --- a/addons/stock_picking_wave/stock_picking_wave.py +++ b/addons/stock_picking_wave/stock_picking_wave.py @@ -31,22 +31,8 @@ class stock_picking_wave(osv.osv): ''' This function print the report for all picking_ids associated to the picking wave ''' - 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.')) - datas = { - 'ids': picking_ids, - 'model': 'stock.picking', - 'form': self.read(cr, uid, picking_ids, context=context) - } - return { - 'type': 'ir.actions.report.xml', - 'report_name': context.get('report', 'stock.picking.list'), - 'datas': datas, - 'nodestroy': True - } + context = context or {} + return self.pool.get("report").get_action(cr, uid, [], 'stock_picking_wave.report_pickingwave', 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 new file mode 100644 index 00000000000..7dc854a8a40 --- /dev/null +++ b/addons/stock_picking_wave/stock_picking_wave_reports.xml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file