From 98552752035db059af7315e4fcb1cb4bcf75e8f6 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Mon, 14 Mar 2016 17:01:11 +0100 Subject: [PATCH] [FIX] sale_crm: opporunities quotes & sales buttons count A `sale.order` is considered a quote when `draft` or `sent`, not just draft. Before this revision, a `sent` quotation was took into account in the amount total of sales, not in the number of quotes. opw-668340 --- addons/sale_crm/crm_lead.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/sale_crm/crm_lead.py b/addons/sale_crm/crm_lead.py index 687f2a99986..80ddc53a874 100644 --- a/addons/sale_crm/crm_lead.py +++ b/addons/sale_crm/crm_lead.py @@ -13,9 +13,9 @@ class crm_lead(models.Model): total = 0.0 nbr = 0 for order in self.order_ids: - if order.state == 'draft': + if order.state in ('draft', 'sent'): nbr += 1 - if order.state not in ('draft', 'cancel'): + if order.state not in ('draft', 'sent', 'cancel'): total += order.currency_id.compute(order.amount_untaxed, self.company_currency) self.sale_amount_total = total self.sale_number = nbr