[IMP] small code improvment
bzr revid: psi@tinyerp.com-20120911093918-2pf605tadf0u6jkb
This commit is contained in:
parent
1401d52c9e
commit
cbe44438b2
|
@ -88,7 +88,7 @@ Dashboard for Sales Manager that includes:
|
|||
'test': [
|
||||
'test/sale_order_demo.yml',
|
||||
'test/picking_order_policy.yml',
|
||||
#'test/manual_order_policy.yml',
|
||||
'test/manual_order_policy.yml',
|
||||
'test/prepaid_order_policy.yml',
|
||||
'test/cancel_order.yml',
|
||||
'test/delete_order.yml',
|
||||
|
|
|
@ -145,9 +145,9 @@ class sale_order(osv.osv):
|
|||
res[sale.id] = 0.0
|
||||
return res
|
||||
|
||||
def _get_invoiced_amount(self, cr, uid, sale_object, context=None):
|
||||
def _get_invoiced_amount(self, cr, uid, sale, context=None):
|
||||
invoiced_amount = 0
|
||||
for invoice in sale_object.invoice_ids:
|
||||
for invoice in sale.invoice_ids:
|
||||
if invoice.state!='cancel':
|
||||
invoiced_amount += invoice.amount_total
|
||||
return invoiced_amount
|
||||
|
@ -173,7 +173,7 @@ class sale_order(osv.osv):
|
|||
res[sale.id] = False
|
||||
break
|
||||
invoiced_amount = self._get_invoiced_amount(cursor, user, sale, context=context)
|
||||
if invoiced_amount != sale.amount_total or not invoice_existence:
|
||||
if invoiced_amount != sale.amount_total and not invoice_existence:
|
||||
res[sale.id] = False
|
||||
return res
|
||||
|
||||
|
|
Loading…
Reference in New Issue