[FIX] stock_picking_wave: fixed picking wave report

bzr revid: qdp-launchpad@openerp.com-20140328105254-0n0jm309n2v4q160
This commit is contained in:
Quentin (OpenERP) 2014-03-28 11:52:54 +01:00
parent 23293e2b03
commit fe7b3c66a3
6 changed files with 12 additions and 18 deletions

View File

@ -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:

View File

@ -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

View File

@ -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',

View File

@ -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', '/') == '/':

View File

@ -1,12 +0,0 @@
<openerp>
<data>
<report
id="action_report_print_picking_wave"
model="stock.picking.wave"
report_type="qweb-pdf"
string="Associated Pickings"
name="stock_picking_wave.report_pickingwave"
file="stock_picking_wave.report_pickingwave"
/>
</data>
</openerp>

View File

@ -13,7 +13,7 @@
</header>
<sheet>
<div class="oe_right oe_button_box">
<button name="print_picking" string="Print all pickings" type="object" context="{'report':'stock.picking.list.internal'}"/>
<button name="print_picking" string="Print all pickings" type="object"/>
</div>
<div class="oe_title">
<h1>