[FIX] website_sale_aplicoop: split cart and cycle stamp in localStorage
965c5c2stored the cart as {cutoff_date, items: {...}} in eskaera_<id>_cart. That broke every other reader of the same key: - checkout_labels.js iterates Object.keys() expecting product IDs and rendered "cutoff_date" / "items" as ghost rows → users on the checkout page saw their cart as empty. - home_delivery.js read/wrote the cart in place; the in-place mutation destroyed the wrapper. - _saveOrderDraft serialised the same object straight to the server, POSTing "cutoff_date" and "items" as productIds. Split the schema: eskaera_<id>_cart keeps the plain {productId: {...}} shape every other JS file already relies on; the cycle marker moves to eskaera_<id>_cart_cycle. _loadCart migrates browsers still holding the v18.0.1.10.0 wrapped value on the next read. Also make eviction strictly opt-in: drop the cart only when we know the current cycle AND the stored cycle disagrees. Missing data on either side (check-status didn't run, XHR failed) → preserve. This restores the checkout page where check-status isn't called. Version bump triggers the in-tab auto-reload added in6e6d1e5for clients already on that build. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
6e6d1e5256
commit
9484f8c349
2 changed files with 46 additions and 22 deletions
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
{ # noqa: B018
|
||||
"name": "Website Sale - Aplicoop",
|
||||
"version": "18.0.1.10.1",
|
||||
"version": "18.0.1.10.2",
|
||||
"category": "Website/Sale",
|
||||
"summary": "Modern replacement of legacy Aplicoop - Collaborative consumption group orders",
|
||||
"author": "Odoo Community Association (OCA), Criptomart",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue