[FIX] website_sale_product_minimal_price: crash on shop with lazy request.pricelist (Odoo 19) - #1273
Open
antoineAkyado wants to merge 1 commit into
Open
Conversation
Contributor
|
Hi @sergio-teruel, |
…icelist (v19) In Odoo 19 request.pricelist is a lazy() proxy (website_sale/models/ir_http.py). _get_website_current_pricelist returned it as-is, so the in-place union in _get_pricelist_variant_items (visited_pricelists |= pricelist) delegated to product.pricelist.__ior__, removed from recordsets in v19, raising AttributeError on the shop page for multi-variant products whose pricelist has sub-pricelists. Materialise the pricelist into a real recordset.
antoineAkyado
force-pushed
the
19.0-fix-wspmp-lazy-pricelist
branch
from
August 3, 2026 12:34
fec7888 to
5a11429
Compare
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.
Bug
On the eCommerce shop page, computing the cheapest variant of a product crashes with:
Traceback
Root cause
Two Odoo 19 changes combine to trigger this:
request.pricelistis now alazy()proxy —website_sale/models/ir_http.py:_get_website_current_pricelist()returns it as-is.BaseModeldefines__or__but not__ior__. For a plain recordset,x |= yfalls back to__or__(fine). For alazy,lazy.__ior__(inodoo/tools/func.py) delegates toproduct.pricelist.__ior__, which no longer exists ->AttributeError._get_pricelist_variant_items()doesvisited_pricelists |= pricelist, wherevisited_pricelistswas initialised from the lazyrequest.pricelist.How to reproduce
product_variant_count > 1).compute_price = 'formula',base = 'pricelist',base_pricelist_idset), so thewhile next_pricelists:loop actually runs and reachesvisited_pricelists |= pricelist.Fix
_get_website_current_pricelistnow materialises the pricelist into a real recordset, so downstream in-place set operations keep working. The existing test is updated to reproduce the lazy scenario as a regression test.