Skip to content

[18.0][FIX] purchase_order_secondary_unit: avoid price recomputation from rounded secondary price#3113

Open
sergio-teruel wants to merge 1 commit into
OCA:18.0from
Tecnativa:18.0-FIX-purchase_order_secondary_unit-more-decimals
Open

[18.0][FIX] purchase_order_secondary_unit: avoid price recomputation from rounded secondary price#3113
sergio-teruel wants to merge 1 commit into
OCA:18.0from
Tecnativa:18.0-FIX-purchase_order_secondary_unit-more-decimals

Conversation

@sergio-teruel

Copy link
Copy Markdown
Contributor

Before this PR
When a purchase line uses a secondary unit with a factor that produces a rounded secondary price, the inverse of secondary_uom_price can recompute price_unit from the rounded value.
Example: supplier price 19.95 and secondary factor 0.9 gives 17.955, displayed/stored as 17.96. The inverse then computes 17.96 / 0.9 = 19.955555..., changing the original supplier price.

After this PR
Skip the inverse recomputation when secondary_uom_price matches the expected value from price_unit * factor within the Product Price decimal precision.
This preserves the supplier price while still allowing manual edits of the secondary unit price to update the base price.

cc @Tecnativa TT63349

ping @carlosdauden @CarlosRoca13 @juancarlosonate-tecnativa @sysadminmatmoz

@OCA-git-bot OCA-git-bot added series:18.0 mod:purchase_order_secondary_unit Module purchase_order_secondary_unit labels Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:purchase_order_secondary_unit Module purchase_order_secondary_unit series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants