[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) <oco@odoo.com>
This commit is contained in:
yosa-odoo
2024-03-15 13:04:48 +00:00
parent 3d5d5cc041
commit e98af4fc26
+1 -1
View File
@@ -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):