[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 = {}
|
res = {}
|
||||||
for sale in self.browse(cursor, user, ids, context=context):
|
for sale in self.browse(cursor, user, ids, context=context):
|
||||||
res[sale.id] = True
|
res[sale.id] = True
|
||||||
|
invoice_existence = False
|
||||||
for invoice in sale.invoice_ids:
|
for invoice in sale.invoice_ids:
|
||||||
if invoice.state != 'paid':
|
if invoice.state!='cancel':
|
||||||
res[sale.id] = False
|
invoice_existence = True
|
||||||
break
|
if invoice.state != 'paid':
|
||||||
if not sale.invoice_ids:
|
res[sale.id] = False
|
||||||
|
break
|
||||||
|
if not invoice_existence:
|
||||||
res[sale.id] = False
|
res[sale.id] = False
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue