mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP]pms: folio_sale_line compare float value round in invoiced folios
This commit is contained in:
@@ -991,9 +991,14 @@ class FolioSaleLine(models.Model):
|
||||
)
|
||||
)
|
||||
# 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
|
||||
)
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user