Skip to content

Commit c8174a7

Browse files
committed
[MIG] 14.0 smile_decimal_precision
1 parent 2ac375a commit c8174a7

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

smile_decimal_precision/__manifest__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
{
55
"name": "Display Decimal Precision",
6-
"version": "15.0.0.0.1",
7-
"depends": ["base"],
6+
"version": "14.0.0.0.1",
7+
"depends": ["web"],
88
"author": "Smile",
99
"license": 'AGPL-3',
1010
"description": """

smile_decimal_precision/models/res_currency.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ class ResCurrency(models.Model):
1515

1616
@api.depends('rounding', 'display_rounding')
1717
def _get_display_decimal_places(self):
18-
if not self.display_rounding:
19-
self.display_decimal_places = self.decimal_places
20-
elif 0 < self.display_rounding < 1:
21-
self.display_decimal_places = \
22-
int(math.ceil(math.log10(1 / self.display_rounding)))
23-
else:
24-
self.display_decimal_places = 0
18+
for currency in self:
19+
if not currency.display_rounding:
20+
currency.display_decimal_places = currency.decimal_places
21+
elif 0 < currency.display_rounding < 1:
22+
currency.display_decimal_places = \
23+
int(math.ceil(math.log10(1 / currency.display_rounding)))
24+
else:
25+
currency.display_decimal_places = 0

0 commit comments

Comments
 (0)