addons-cm/website_sale_aplicoop/controllers
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
..
__init__.py Aplicoop desde el repo de kidekoop 2026-02-11 15:32:11 +01:00
exceptions.py [FIX] website_sale_aplicoop: lint fixes (exception chaining, imports, remove unused vars) 2026-05-20 16:05:14 +02:00
portal.py [I18N] website_sale_aplicoop: Translate weekdays 2026-03-03 15:26:01 +01:00
website_sale.py [FIX] website_sale_aplicoop: clear cart when group order cutoff has passed 2026-05-28 13:51:37 +02:00
website_sale_i18n.py [IMP] website_sale_aplicoop: improve i18n label fallbacks and response parsing 2026-05-25 12:28:33 +02:00
website_sale_pickup.py [FIX] website_sale_aplicoop: lint fixes (exception chaining, imports, remove unused vars) 2026-05-20 16:05:14 +02:00
website_sale_pricing.py [FIX] website_sale_aplicoop: fix account.tax access error and duplicate home-delivery handler 2026-05-20 18:20:02 +02:00
website_sale_products.py [FIX] website_sale_aplicoop: lint fixes (exception chaining, imports, remove unused vars) 2026-05-20 16:05:14 +02:00
website_sale_utils.py [FIX] website_sale_aplicoop: lint fixes (exception chaining, imports, remove unused vars) 2026-05-20 16:05:14 +02:00
website_sale_validators.py [FIX] website_sale_aplicoop: lint fixes (exception chaining, imports, remove unused vars) 2026-05-20 16:05:14 +02:00