Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] sale_triple_discount: restore original discount field's precision by using change_digit function #1

Open
wants to merge 1 commit into
base: 12.0-fix-sale_triple_discount-round_discount
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions sale_triple_discount/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ def triple_discount_preprocess(self):
# more digits than allowed from field's precision,
# so let's increase it just for saving it correctly in cache
discount_field = self._fields['discount']
discount_original_digits = discount_field._digits
discount_field._digits = (16, 10)

for line in self:
Expand All @@ -129,7 +128,7 @@ def triple_discount_preprocess(self):
})

# Restore discount field's precision
discount_field._digits = discount_original_digits
discount_field._digits = dp.get_precision("Discount")(self.env.cr)
return prev_values

@api.model
Expand Down