addons-cm/website_sale_aplicoop/static/src/js
GitHub Copilot b01794c319 [FIX] website_sale_aplicoop: clear cart when group order cutoff has passed
Previously, when a user reopened a group order whose cutoff day had
already passed, the /eskaera/check-status response correctly triggered
the localStorage cart clear, but _autoLoadDraftOnInit immediately
re-fetched the previous cycle's draft sale.order from /eskaera/load-draft
(which only guarded on group_order.state, not cutoff_date) and the stale
items reappeared in the cart, confusing users.

Add a cutoff_date < today guard to load_draft_cart so the endpoint
returns the existing clear_cart unavailable response, and short-circuit
_autoLoadDraftOnInit on the frontend via a _skipDraftAutoLoad flag set
in _checkGroupOrderStatus to avoid the now-pointless XHR round trip.

Covered by a new regression test in tests/test_group_order_status_endpoint.py.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 13:51:37 +02:00
..
checkout_labels.js [FIX] website_sale_aplicoop: Remove redundant string= attributes and fix OCA linting warnings 2026-02-18 17:54:43 +01:00
checkout_summary.js [FIX] website_sale_aplicoop: Remove redundant string= attributes and fix OCA linting warnings 2026-02-18 17:54:43 +01:00
home_delivery.js [FIX] website_sale_aplicoop: toggle reparto desde carrito 2026-02-27 15:43:59 +01:00
i18n_helpers.js [FIX] website_sale_aplicoop: Remove redundant string= attributes and fix OCA linting warnings 2026-02-18 17:54:43 +01:00
i18n_manager.js [FIX] website_sale_aplicoop: Remove redundant string= attributes and fix OCA linting warnings 2026-02-18 17:54:43 +01:00
infinite_scroll.js [FIX] website_sale_aplicoop: fix aplicoopShop -> groupOrderShop reference 2026-03-05 22:03:34 +01:00
realtime_search.js [IMP] website_sale_aplicoop: Auto-carga de productos al filtrar por tags 2026-02-18 19:01:33 +01:00
website_sale.js [FIX] website_sale_aplicoop: clear cart when group order cutoff has passed 2026-05-28 13:51:37 +02:00