From e4ba2d43c927bfa2f81d3a7349a53f507c284820 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 1 Dec 2015 10:55:50 +0100 Subject: [PATCH] [FIX] sale_crm: invoiced button in dashboard The invoiced amount in the Sales dashbord must be compute with the customer invoices. opw:657538 --- 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 0980eff5f78..687f2a99986 100644 --- a/addons/sale_crm/crm_lead.py +++ b/addons/sale_crm/crm_lead.py @@ -34,7 +34,8 @@ class crm_lead(models.Model): account_invoice_domain = [ ('state', 'in', ['open', 'paid']), ('user_id', '=', uid), - ('date', '>=', date.today().replace(day=1) - relativedelta(months=+1)) + ('date', '>=', date.today().replace(day=1) - relativedelta(months=+1)), + ('type', 'in', ['out_invoice', 'out_refund']) ] invoice_ids = self.pool.get('account.invoice').search_read(cr, uid, account_invoice_domain, ['date', 'amount_untaxed_signed'], context=context) @@ -47,5 +48,4 @@ class crm_lead(models.Model): res['invoiced']['last_month'] += inv['amount_untaxed_signed'] res['invoiced']['target'] = self.pool('res.users').browse(cr, uid, uid, context=context).target_sales_invoiced - return res