Skip to content
Snippets Groups Projects
Commit 998db2c6 authored by Gaurav Panchal's avatar Gaurav Panchal Committed by Martin Trigaux
Browse files

[FIX]stock: return of 'To Be Invoiced' picking should also be invoiced

When creating a return picking, the default invoice state is 'To Be Invoiced' if
returned picking was invoiced. However if the invoice of the picking has not
been generated yet (state '2binvoiced'), the return should also be invoiced.
Fixes #4002
parent ba70393b
Branches
Tags
No related merge requests found
......@@ -69,10 +69,10 @@ class stock_return_picking(osv.osv_memory):
pick = pick_obj.browse(cr, uid, record_id, context=context)
if pick:
if 'invoice_state' in fields:
if pick.invoice_state=='invoiced':
res.update({'invoice_state': '2binvoiced'})
if pick.invoice_state in ['invoiced','2binvoiced']:
res['invoice_state'] = '2binvoiced'
else:
res.update({'invoice_state': 'none'})
res['invoice_state'] = 'none'
return_history = self.get_return_history(cr, uid, record_id, context)
for line in pick.move_lines:
qty = line.product_qty - return_history.get(line.id, 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment