[FIX] purchase_ux: fix currency rate precision in change currency wizard#338
Closed
les-adhoc wants to merge 1 commit into
Closed
[FIX] purchase_ux: fix currency rate precision in change currency wizard#338les-adhoc wants to merge 1 commit into
les-adhoc wants to merge 1 commit into
Conversation
When converting from a high-value currency (e.g. ARS) to a low-value one (e.g. USD), `_convert(1.0, ...)` rounded the result to the destination currency's decimal places (2), producing 0.00 and zeroing out all prices. Fix by using `_get_conversion_rate()` (raw rate, no rounding) — same approach as account_ux — and adding `digits=(16, 6)` to the field so the rate is stored and displayed with enough precision. Closes #120310 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Contributor
|
@roboadhoc r+ nobump |
roboadhoc
pushed a commit
that referenced
this pull request
Jun 17, 2026
When converting from a high-value currency (e.g. ARS) to a low-value one (e.g. USD), `_convert(1.0, ...)` rounded the result to the destination currency's decimal places (2), producing 0.00 and zeroing out all prices. Fix by using `_get_conversion_rate()` (raw rate, no rounding) — same approach as account_ux — and adding `digits=(16, 6)` to the field so the rate is stored and displayed with enough precision. Closes #120310 closes #338 Signed-off-by: Matias Velazquez <mav@adhoc.com.ar> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
_convert(1.0, to_currency)rounds the result to the destination currency's decimal places (e.g. USD = 2), producing0.00when converting from ARS → USD and zeroing out all line prices._get_conversion_rate()(raw rate, no rounding) — same approach already used byaccount_ux.digits=(16, 6)tocurrency_ratefield so the rate is stored and displayed with enough precision.Test plan
0.000667), precio se recalcula correctamente (no queda en 0)Closes #120310