[FIX] price_security: discount restriction on lines added from the ca… - #919
Closed
lef-adhoc wants to merge 1 commit into
Closed
[FIX] price_security: discount restriction on lines added from the ca…#919lef-adhoc wants to merge 1 commit into
lef-adhoc wants to merge 1 commit into
Conversation
Contributor
lef-adhoc
force-pushed
the
19.0-h-123508-lef
branch
2 times, most recently
from
July 24, 2026 18:38
d795806 to
3739e90
Compare
…talog The api.constrains on discount ran during the create flush, comparing discount values that may not be settled yet. With sale_triple_discount installed, its circular compute/inverse chain over discount1/2/3 leaves the pricelist discount unsettled at that point, so lines created without an explicit discount (e.g. adding products from the catalog view) transiently read 0.0 and were wrongly rejected for users with discount restrictions, while the same product added from the order form (which sends discount1 explicitly) passed. - price_security: validate at the end of create/write instead of the constraint, expose the _price_security_settle_discount hook, and compare net discounts using float precision (discount arithmetic can produce values like 32.99999999999999 that failed strict comparison). - price_security_sale_triple_discount: new auto-installable bridge module that settles the triple discount compute chain for lines created without explicit discount before the restriction validation.
lef-adhoc
force-pushed
the
19.0-h-123508-lef
branch
from
July 28, 2026 18:33
3739e90 to
6449ec0
Compare
Contributor
|
@roboadhoc r+ nobump |
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.

…talog
The api.constrains on discount ran during the create flush, comparing discount values that may not be settled yet. With sale_triple_discount installed, its circular compute/inverse chain over discount1/2/3 leaves the pricelist discount unsettled at that point, so lines created without an explicit discount (e.g. adding products from the catalog view) transiently read 0.0 and were wrongly rejected for users with discount restrictions, while the same product added from the order form (which sends discount1 explicitly) passed.