From e98af4fc263c86451c567fd3c1ab2fa1be8163e2 Mon Sep 17 00:00:00 2001 From: yosa-odoo Date: Thu, 7 Mar 2024 11:19:31 +0100 Subject: [PATCH] [FIX] account: change typo constraint groupby Steps to reproduce: - accounting report > P&L > net profit: set the 'groupby' to 'account_id' - save - try to open the P&L -> Invalid Operation Cause: During the improvement of the report a small change has been forgotten The `groupby` has been changed to `user_groupby` https://github.com/odoo/enterprise/commit/99c82df3d24209de12e2442fd15d2472d9e968f6#diff-bc8d6ed5aa6dab6b7ba46566170cdb7297104580d9b8d6c7081f72e3c2a5a9c4R187-R191 and we forgot to change the `api.constrains`'s args opw-3714626 closes odoo/odoo#156879 Signed-off-by: Olivier Colson (oco) --- addons/account/models/account_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_report.py b/addons/account/models/account_report.py index 265ffffcc18..d554f842126 100644 --- a/addons/account/models/account_report.py +++ b/addons/account/models/account_report.py @@ -342,7 +342,7 @@ class AccountReportLine(models.Model): if report_line.parent_id.groupby or report_line.parent_id.user_groupby: raise ValidationError(_("A line cannot have both children and a groupby value (line '%s').", report_line.parent_id.name)) - @api.constrains('expression_ids', 'groupby') + @api.constrains('expression_ids', 'groupby', 'user_groupby') def _validate_formula(self): for expression in self.expression_ids: if expression.engine == 'aggregation' and (expression.report_line_id.groupby or expression.report_line_id.user_groupby):