From b11c49d6f606e3d854cf9db2f4f93811b87da138 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 27 Feb 2015 15:41:28 +0100 Subject: [PATCH] [FIX] sale: sales team amount invoiced exclude purchases This is possible to assign a sales team to a supplier invoices Supplier invoices must be rejected in the invoiced count of sales team (in the kanban view of sales team). The invoiced amount must be the customer invoices amount minus the customer refund invoices amount opw-629105 --- addons/sale/sales_team.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sales_team.py b/addons/sale/sales_team.py index c782660d0ea..ef4891de8e8 100644 --- a/addons/sale/sales_team.py +++ b/addons/sale/sales_team.py @@ -36,7 +36,7 @@ class crm_case_section(osv.osv): res = {} for id in ids: - created_domain = [('section_id', '=', id), ('state', 'not in', ['draft', 'cancel']), ('date', '>=', date_begin), ('date', '<=', date_end)] + created_domain = [('type', 'in', ['out_invoice', 'out_refund']), ('section_id', '=', id), ('state', 'not in', ['draft', 'cancel']), ('date', '>=', date_begin), ('date', '<=', date_end)] values = self.__get_bar_values(cr, uid, obj, created_domain, ['price_total', 'date'], 'price_total', 'date', context=context) for value in values: value['value'] = float_repr(value.get('value', 0), precision_digits=self.pool['decimal.precision'].precision_get(cr, uid, 'Account'))