From cbe44438b2ab31143821e56809a296c3fbcf531a Mon Sep 17 00:00:00 2001 From: "Purnendu Singh (OpenERP)" Date: Tue, 11 Sep 2012 15:09:18 +0530 Subject: [PATCH] [IMP] small code improvment bzr revid: psi@tinyerp.com-20120911093918-2pf605tadf0u6jkb --- addons/sale/__openerp__.py | 2 +- addons/sale/sale.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py index 91869a60aad..aa712f1d7b5 100644 --- a/addons/sale/__openerp__.py +++ b/addons/sale/__openerp__.py @@ -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', diff --git a/addons/sale/sale.py b/addons/sale/sale.py index eedab3bce8d..89d9a694485 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -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