From 29291c35ea55724a82205b9f7471ba797f17bdaf Mon Sep 17 00:00:00 2001 From: "hda@tinyerp.com" <> Date: Fri, 29 Aug 2008 15:14:06 +0530 Subject: [PATCH] bugfix bzr revid: hda@tinyerp.com-20080829094406-ghw2lj7fclwjvktv --- addons/purchase/purchase.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 6d68ccdf665..0fab3c30145 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -90,8 +90,7 @@ class purchase_order(osv.osv): res = {} for purchase in self.browse(cursor, user, ids, context=context): tot = 0.0 - - if purchase.invoice_id.state not in ('draft','cancel'): + if purchase.invoice_id and purchase.invoice_id.state not in ('draft','cancel'): tot += purchase.invoice_id.amount_untaxed if tot: res[purchase.id] = tot * 100.0 / purchase.amount_untaxed