[MERGE] lp:929373. Courtesy of Arif
bzr revid: qdp-launchpad@openerp.com-20120216165253-01d70hrlf8pmnn7x
This commit is contained in:
commit
25a8023696
|
@ -147,11 +147,14 @@ class sale_order(osv.osv):
|
|||
res = {}
|
||||
for sale in self.browse(cursor, user, ids, context=context):
|
||||
res[sale.id] = True
|
||||
invoice_existence = False
|
||||
for invoice in sale.invoice_ids:
|
||||
if invoice.state != 'paid':
|
||||
res[sale.id] = False
|
||||
break
|
||||
if not sale.invoice_ids:
|
||||
if invoice.state!='cancel':
|
||||
invoice_existence = True
|
||||
if invoice.state != 'paid':
|
||||
res[sale.id] = False
|
||||
break
|
||||
if not invoice_existence:
|
||||
res[sale.id] = False
|
||||
return res
|
||||
|
||||
|
|
Loading…
Reference in New Issue