[FIX] Stock_invoice_directly : Corrected context parameters and passed to the next wizard of invoicing (ref: case 4703)

bzr revid: jvo@tinyerp.com-20110328100438-y1pkjsir165bwjz0
This commit is contained in:
Jenil(OpenERP) 2011-03-28 15:34:38 +05:30 committed by Jay Vora (OpenERP)
parent ed4c641982
commit 33c3e6adf3
1 changed files with 4 additions and 0 deletions

View File

@ -37,7 +37,10 @@ class invoice_directly(osv.osv_memory):
context = {}
result = super(invoice_directly, self).do_partial(cr, uid, ids, context)
pick_obj = self.pool.get('stock.picking')
context.update({'active_model':'stock.picking'})
picking_ids = context.get('active_ids', False)
if picking_ids:
context.update({'active_id':picking_ids[0]})
pick = pick_obj.browse(cr, uid, picking_ids, context=context)[0]
if pick.invoice_state == '2binvoiced':
return {
@ -47,6 +50,7 @@ class invoice_directly(osv.osv_memory):
'res_model': 'stock.invoice.onshipping',
'type': 'ir.actions.act_window',
'target': 'new',
'context': context
}
return {'type': 'ir.actions.act_window_close'}