From f43fd2c5ec6de659cd9c371ae6ffa3ab66b6e940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20=C3=89vrard?= Date: Mon, 30 May 2011 16:22:19 +0200 Subject: [PATCH] Fix invoiced quantity of service products --- purchase.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/purchase.py b/purchase.py index e2f6bd0a65..66e3f10d3a 100644 --- a/purchase.py +++ b/purchase.py @@ -1080,7 +1080,9 @@ class PurchaseLine(ModelSQL, ModelView): res['note'] = line.note if line.type != 'line': return [res] - if line.purchase.invoice_method == 'order': + if (line.sale.invoice_method == 'order' + or not line.product + or line.product.type == 'service'): quantity = line.quantity else: quantity = 0.0