From 7395d1b0ad85ef7efe40fd830412805fe17179c9 Mon Sep 17 00:00:00 2001 From: Ethan Hildick Date: Tue, 15 Feb 2022 15:55:05 +0100 Subject: [PATCH] [14.0][FIX] account_financial_report: Run compute in multi --- account_financial_report/__manifest__.py | 2 +- .../models/account_group.py | 24 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/account_financial_report/__manifest__.py b/account_financial_report/__manifest__.py index a3849cfa..7c35102e 100644 --- a/account_financial_report/__manifest__.py +++ b/account_financial_report/__manifest__.py @@ -6,7 +6,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Account Financial Reports", - "version": "15.0.2.1.0", + "version": "15.0.2.1.2", "category": "Reporting", "summary": "OCA Financial Reports", "author": "Camptocamp SA," diff --git a/account_financial_report/models/account_group.py b/account_financial_report/models/account_group.py index d6b1c6cf..726765cd 100644 --- a/account_financial_report/models/account_group.py +++ b/account_financial_report/models/account_group.py @@ -30,20 +30,24 @@ class AccountGroup(models.Model): @api.depends("name", "parent_id.complete_name") def _compute_complete_name(self): """Forms complete name of location from parent location to child location.""" - if self.parent_id.complete_name: - self.complete_name = "{}/{}".format(self.parent_id.complete_name, self.name) - else: - self.complete_name = self.name + for group in self: + if group.parent_id.complete_name: + group.complete_name = "{}/{}".format( + group.parent_id.complete_name, group.name + ) + else: + group.complete_name = group.name @api.depends("code_prefix_start", "parent_id.complete_code") def _compute_complete_code(self): """Forms complete code of location from parent location to child location.""" - if self.parent_id.complete_code: - self.complete_code = "{}/{}".format( - self.parent_id.complete_code, self.code_prefix_start - ) - else: - self.complete_code = self.code_prefix_start + for group in self: + if group.parent_id.complete_code: + group.complete_code = "{}/{}".format( + group.parent_id.complete_code, group.code_prefix_start + ) + else: + group.complete_code = group.code_prefix_start @api.depends("parent_id", "parent_id.level") def _compute_level(self):