[FIX] stock_picking_wave: fixed picking wave report
bzr revid: qdp-launchpad@openerp.com-20140328105254-0n0jm309n2v4q160
This commit is contained in:
parent
23293e2b03
commit
fe7b3c66a3
|
@ -403,6 +403,7 @@ class Report(osv.Model):
|
||||||
'report_name': report.report_name,
|
'report_name': report.report_name,
|
||||||
'report_type': report.report_type,
|
'report_type': report.report_type,
|
||||||
'report_file': report.report_file,
|
'report_file': report.report_file,
|
||||||
|
'context': context,
|
||||||
}
|
}
|
||||||
|
|
||||||
if datas:
|
if datas:
|
||||||
|
|
|
@ -6,8 +6,6 @@ openerp.report = function(instance) {
|
||||||
var self = this;
|
var self = this;
|
||||||
instance.web.blockUI();
|
instance.web.blockUI();
|
||||||
action = _.clone(action);
|
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;
|
_t = instance.web._t;
|
||||||
|
|
||||||
// QWeb reports
|
// QWeb reports
|
||||||
|
|
|
@ -34,7 +34,6 @@ This module adds the picking wave option in warehouse management.
|
||||||
'stock_picking_wave_view.xml',
|
'stock_picking_wave_view.xml',
|
||||||
'stock_picking_wave_sequence.xml',
|
'stock_picking_wave_sequence.xml',
|
||||||
'wizard/picking_to_wave_view.xml',
|
'wizard/picking_to_wave_view.xml',
|
||||||
'stock_picking_wave_reports.xml',
|
|
||||||
],
|
],
|
||||||
'demo': [
|
'demo': [
|
||||||
'stock_picking_wave_demo.xml',
|
'stock_picking_wave_demo.xml',
|
||||||
|
|
|
@ -31,8 +31,16 @@ class stock_picking_wave(osv.osv):
|
||||||
'''
|
'''
|
||||||
This function print the report for all picking_ids associated to the picking wave
|
This function print the report for all picking_ids associated to the picking wave
|
||||||
'''
|
'''
|
||||||
context = context or {}
|
if context is None:
|
||||||
return self.pool.get("report").get_action(cr, uid, ids, 'stock_picking_wave.report_pickingwave', context=context)
|
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):
|
def create(self, cr, uid, vals, context=None):
|
||||||
if vals.get('name', '/') == '/':
|
if vals.get('name', '/') == '/':
|
||||||
|
|
|
@ -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>
|
|
|
@ -13,7 +13,7 @@
|
||||||
</header>
|
</header>
|
||||||
<sheet>
|
<sheet>
|
||||||
<div class="oe_right oe_button_box">
|
<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>
|
||||||
<div class="oe_title">
|
<div class="oe_title">
|
||||||
<h1>
|
<h1>
|
||||||
|
|
Loading…
Reference in New Issue