Skip to content

[18.0][ADD] sale_pricelist_multi_discount#4365

Draft
LorenzoC0 wants to merge 1 commit into
OCA:18.0from
LorenzoC0:18.0-add-sale_pricelist_multi_discount
Draft

[18.0][ADD] sale_pricelist_multi_discount#4365
LorenzoC0 wants to merge 1 commit into
OCA:18.0from
LorenzoC0:18.0-add-sale_pricelist_multi_discount

Conversation

@LorenzoC0
Copy link
Copy Markdown

Depends on OCA/account-invoicing#2364 and #4364

This module adds a distribution-like field in the pricelist discount field, enabling infinite multiplicative discounts.

This module likely conflicts with some other modules that modify the behavior of the discount field in pricelists. I could use some help figuring out which of these modules are incompatible, so I can add them as exclusions in the manifest. Thanks!

Adds a distribution-like field in the pricelist formula discount field
@OCA-git-bot OCA-git-bot added series:18.0 mod:sale_pricelist_multi_discount Module sale_pricelist_multi_discount labels May 26, 2026
Copy link
Copy Markdown
Member

@eLBati eLBati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

Distribution widget in the *Percentage* and *Formula* compute modes.
When the rule has a non-empty distribution, the rule's `_compute_price`
applies all discounts multiplicatively and the sale order line copies
the same list into its own `discount_distribution` field.<> No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the <>

"by this pricelist rule.",
)

def _compute_price(self, product, quantity, uom, date, currency=None):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of overriding _compute_price, is it possible to store the aggregated percentage into the native percent_price / price_discount whenever discount_distribution changes (compute/inverse). Then core's _compute_price works unmodified and the override disappears entirely.

Also, README should be changed about percent_price

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:sale_pricelist_multi_discount Module sale_pricelist_multi_discount series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants