[FIX] purchase_ux: skip standard_price fallback when seller exists#336
Open
jcadhoc wants to merge 1 commit into
Open
[FIX] purchase_ux: skip standard_price fallback when seller exists#336jcadhoc wants to merge 1 commit into
jcadhoc wants to merge 1 commit into
Conversation
_compute_price_unit_and_date_planned_and_name was applying standard_price as a fallback for any line with price_unit=0, even when a seller was configured. With product_replenishment_cost installed, standard_price is overwritten by the replenishment-cost cron (often in ARS), causing wrong prices when the seller later sets the correct net_price. Backport/adaptation of ingadhoc#325 to 18.0. The 19.0 fix uses `selected_seller_id` (field not present in 18.0); here we replace it with an explicit _select_seller() call — if a seller is found, we skip the standard_price fallback and let product_replenishment_cost resolve the price via net_price.
Contributor
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.

Problem
_compute_price_unit_and_date_planned_and_nameinpurchase_uxappliedstandard_priceas a fallback for any line whereprice_unit == 0, even when a seller was configured for that product/partner. Withproduct_replenishment_costinstalled,standard_priceis overwritten by the replenishment-cost cron (typically in ARS), so the fallback produces incorrect prices instead of lettingproduct_replenishment_costresolve the correctnet_price.Fix
Before applying the
standard_pricefallback, check whether a seller exists via_select_seller(). If a seller is found, skip the fallback and letproduct_replenishment_costset the price vianet_price.Notes
selected_seller_id(field not present in Odoo 18); here we replace it with an explicit_select_seller()call on lines whereprice_unit == 0.