From afefa1b7717b47f5d5c2c156be82d4aaed789bf7 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Thu, 6 Jul 2017 16:46:17 +0200 Subject: [PATCH] [FIX] account: Display the correct records on 'Invoice' button Currently it shows all the invoices, not the sales invoices that are paid or validated --- addons/account/models/partner.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/account/models/partner.py b/addons/account/models/partner.py index 7794c2490d1..253a2e2b680 100644 --- a/addons/account/models/partner.py +++ b/addons/account/models/partner.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- +from ast import literal_eval from operator import itemgetter import time @@ -442,7 +443,7 @@ class ResPartner(models.Model): ''' This function returns an action that display invoices/refunds made for the given partners. ''' - action = self.env.ref('account.action_invoice_refund_out_tree') - result = action.read()[0] - result['domain'] = [('partner_id', 'child_of', self.ids)] - return result + action = self.env.ref('account.action_invoice_refund_out_tree').read()[0] + action['domain'] = literal_eval(action['domain']) + action['domain'].append(('partner_id', 'child_of', self.ids)) + return action