Skip to content

Commit

Permalink
[17.0][MIG] bi_view_editor: Fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniodavid committed Jan 24, 2025
1 parent 4c06fef commit 9966548
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bi_view_editor/models/bve_view_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ class BveViewLine(models.Model):
measure = fields.Boolean()
in_list = fields.Boolean()
list_attr = fields.Selection(
[("sum", "Sum"), ("avg", "Average")], string="List Attribute", default="sum"
[("sum", "Sum"), ("avg", "Average")],
string="List Attribute",
default="sum",
)
view_field_type = fields.Char(compute="_compute_view_field_type")

Expand All @@ -44,11 +46,11 @@ def _compute_view_field_type(self):
@api.constrains("row", "column", "measure")
def _constrains_options_check(self):
measure_types = ["float", "integer", "monetary"]
for line in self.filtered(lambda l: l.row or l.column):
for line in self.filtered(lambda line: line.row or line.column):
if line.join_model_id or line.ttype in measure_types:
err_msg = _("This field cannot be a row or a column.")
raise ValidationError(err_msg)
for line in self.filtered(lambda l: l.measure):
for line in self.filtered(lambda line: line.measure):
if line.join_model_id or line.ttype not in measure_types:
err_msg = _("This field cannot be a measure.")
raise ValidationError(err_msg)
Expand Down

0 comments on commit 9966548

Please sign in to comment.