diff --git a/addons/account/controllers/portal.py b/addons/account/controllers/portal.py index 6177008ca69..8723334ffcd 100644 --- a/addons/account/controllers/portal.py +++ b/addons/account/controllers/portal.py @@ -10,12 +10,13 @@ from odoo.http import request class PortalAccount(CustomerPortal): - def _prepare_home_portal_values(self): - values = super(PortalAccount, self)._prepare_home_portal_values() - invoice_count = request.env['account.move'].search_count([ - ('move_type', 'in', ('out_invoice', 'in_invoice', 'out_refund', 'in_refund', 'out_receipt', 'in_receipt')), - ]) - values['invoice_count'] = invoice_count + def _prepare_home_portal_values(self, counters): + values = super()._prepare_home_portal_values(counters) + if 'invoice_count' in counters: + invoice_count = request.env['account.move'].search_count([ + ('move_type', 'in', ('out_invoice', 'in_invoice', 'out_refund', 'in_refund', 'out_receipt', 'in_receipt')), + ]) + values['invoice_count'] = invoice_count return values # ------------------------------------------------------------ diff --git a/addons/account/views/account_portal_templates.xml b/addons/account/views/account_portal_templates.xml index a910e0db8c2..90c4604a4d6 100644 --- a/addons/account/views/account_portal_templates.xml +++ b/addons/account/views/account_portal_templates.xml @@ -12,12 +12,12 @@ - - - - - -