[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:
parent
ed4c641982
commit
33c3e6adf3
|
@ -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'}
|
||||
|
||||
|
|
Loading…
Reference in New Issue