[19.0][FIX] sale_order_import: propagate line currency - #1385
Open
Ricardoalso wants to merge 1 commit into
Open
Conversation
`_prepare_create_order_line` already pre-populated `company_id` in `vals` before calling `play_onchanges` (see f26937d) because `sale.order.line.company_id` is a related field that ends up empty otherwise. `currency_id` has the exact same problem -- related, readonly, no inverse -- so `play_onchanges` drops it from `so_vals` and later bakes an explicit `False` into the line's cache, which crashes any percentage/formula pricelist rule with: ValueError: Expected singleton: res.currency() Apply the same fix pattern: add `_prepare_order_line_get_currency_id`, mirroring `_prepare_order_line_get_company_id`, and pre-populate `currency_id` in `vals` before `play_onchanges` runs.
Ricardoalso
force-pushed
the
sale_order_import_currency_id
branch
from
August 7, 2026 12:36
0b517aa to
bd57c5e
Compare
PaoloYam
approved these changes
Aug 7, 2026
ivantodorovich
approved these changes
Aug 10, 2026
Contributor
|
This PR has the |
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.
_prepare_create_order_linealready pre-populatedcompany_idinvalsbefore callingplay_onchanges(see f26937d) becausesale.order.line.company_idis a related field that ends up empty otherwise.currency_idhas the exact same problem -- related, readonly, no inverse -- soplay_onchangesdrops it fromso_valsand later bakes an explicitFalseinto the line's cache, which crashes any percentage/formula pricelist rule with:Apply the same fix pattern: add
_prepare_order_line_get_currency_id, mirroring_prepare_order_line_get_company_id, and pre-populatecurrency_idinvalsbeforeplay_onchangesruns.