[16.0][IMP] sale_pricelist_from_commitment_date: enable feature on pricelists#3205
[16.0][IMP] sale_pricelist_from_commitment_date: enable feature on pricelists#3205
Conversation
ee11fd6 to
45e8635
Compare
|
@sebalix Could you check tests? |
299cedb to
d08a08a
Compare
|
We have some tests related to I cannot reproduce the issue locally with EDIT: it's definitely linked, setting the module as |
ac23083 to
d08a08a
Compare
da3be3e to
7a4308a
Compare
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
alexey-pelykh
left a comment
There was a problem hiding this comment.
Thanks for this improvement, @sebalix. Making the commitment date pricing opt-in per pricelist is a solid design choice -- it gives users proper control rather than silently overriding the standard date logic for all pricelists.
The implementation looks good overall. The refactoring of _compute_price_unit and _compute_pricelist_item_id to use groupby and batch lines per order is a welcome improvement over the previous per-line loop, and extracting _get_pricelist_date() on sale.order provides a clean extension point. The migration correctly enables the flag on all existing pricelists to preserve current behavior on upgrade.
One thing that still seems unresolved though: @sebalix confirmed back in July 2024 that this PR causes sale_global_discount tests to fail (the test_02_global_sale_discounts_from_partner assertion). Setting this module as non-installable makes CI green again, so the interaction is confirmed. Has there been any progress on diagnosing or fixing that? The PR won't be mergeable until cross-module compatibility is sorted out.
Minor observation on the view: the price_based_on_delivery_date field could benefit from a string and help attribute to make it clear to end users what this toggle does (e.g. "Use the commitment/expected delivery date instead of the order date for pricelist rule matching").
Enable it by default (retro-compatibility).
…commitment date is defined
…ure on pricelists
ff7f0e4 to
277526f
Compare
42a8925 to
277526f
Compare
|
for order, lines in groupby(self, key=lambda line: line.order_id): odoo.tools.groupby requires the recordset to be sorted by the same key. If not sorted, grouping becomes inconsistent and some lines are skipped or mis-grouped. That silently corrupts the price computation. In standard perhaps this came from that point. to be check if someone have another idea. i've try to change the group by and sort but nothing change. |
Enable it by default (retro-compatibility).