[FIX] Sale : account_invoice_end() corrected/optimized so that it does not create any regression of duplicated pickings for SO
bzr revid: gpa@tinyerp.com-20100511111240-a0ajvroqcazkzc8u
This commit is contained in:
parent
14dc743c61
commit
06d2f4d107
|
@ -510,18 +510,14 @@ class sale_order(osv.osv):
|
|||
def action_invoice_end(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
for order in self.browse(cr, uid, ids, context=context):
|
||||
val = {'invoiced': True}
|
||||
if order.state == 'invoice_except':
|
||||
val['state'] = 'progress'
|
||||
|
||||
for line in order.order_line:
|
||||
towrite = []
|
||||
if line.state == 'exception':
|
||||
towrite.append(line.id)
|
||||
if towrite:
|
||||
self.pool.get('sale.order.line').write(cr, uid, towrite, {'state': 'confirmed'}, context=context)
|
||||
self.write(cr, uid, [order.id], val)
|
||||
self.pool.get('sale.order.line').write(cr, uid, [line.id], {'state': 'confirmed'}, context=context)
|
||||
|
||||
if order.state == 'invoice_except':
|
||||
self.write(cr, uid, [order.id], {'state' : 'progress'}, context=context)
|
||||
|
||||
return True
|
||||
|
||||
|
|
Loading…
Reference in New Issue