Skip to content

Commit

Permalink
[IMP]pms: folio_sale_line compare float value round in invoiced folios
Browse files Browse the repository at this point in the history
  • Loading branch information
DarioLodeiros committed Oct 10, 2024
1 parent 864c409 commit 7b9c7bc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pms/models/folio_sale_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,9 +991,14 @@ def write(self, values):
)
)
# We check that dont modified the protected fields in locked folios
# if field is float, we need to round it to compare with the original value
if self.filtered(
lambda l: any(
values.get(field.name) != getattr(l, field.name)
round(values.get(field.name), 2)
!= round(getattr(l, field.name), 2)
if isinstance(values.get(field.name), float)
and isinstance(getattr(l, field.name), float)
else values.get(field.name) != getattr(l, field.name)
for field in fields_modified
)
):
Expand Down

0 comments on commit 7b9c7bc

Please sign in to comment.