[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
This commit is contained in:
Denis Ledoux
2016-03-14 17:02:53 +01:00
parent 01cff457e9
commit 9855275203
+2 -2
View File
@@ -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