From 37569695174f7b20f2d142c46552df3a06354cca Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 5 Jan 2016 13:38:44 +0100 Subject: [PATCH] [FIX] account: total_invoiced in res.partner "total_invoiced" must only take customer invoices into account because when you click on the button "invoiced" in the partner view form you just see the customer invoices. opw:665574 --- addons/account/models/partner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/models/partner.py b/addons/account/models/partner.py index e1b7457556d..1c0789246e8 100644 --- a/addons/account/models/partner.py +++ b/addons/account/models/partner.py @@ -306,7 +306,8 @@ class ResPartner(models.Model): # generate where clause to include multicompany rules where_query = account_invoice_report._where_calc([ - ('partner_id', 'in', all_partner_ids), ('state', 'not in', ['draft', 'cancel']), ('company_id', '=', self.env.user.company_id.id) + ('partner_id', 'in', all_partner_ids), ('state', 'not in', ['draft', 'cancel']), ('company_id', '=', self.env.user.company_id.id), + ('type', 'in', ('out_invoice', 'out_refund')) ]) account_invoice_report._apply_ir_rules(where_query, 'read') from_clause, where_clause, where_clause_params = where_query.get_sql()