addons-cm/website_sale_aplicoop/controllers
GitHub Copilot 3b8cb7582b [FIX] website_sale_aplicoop: scope draft lookup to active cycle window
The /eskaera/load-draft endpoint was returning previous-cycle drafts when
group_order.cutoff_date was still in the future but group_order.pickup_date
had not yet been recomputed (its compute only depends on pickup_day and
start_date). Both the stale group_order.pickup_date and the old draft's
pickup_date held the same past value, so the exact-pickup-date filter in
_find_recent_draft_order matched the stale draft and the cart was
repopulated with old products immediately after being cleared.

Replace the pickup_date exact-match + current-week fallback with a single
cutoff-anchored window: create_date in [cutoff_date - 6 days, cutoff_date].
Drafts created outside that window belong to a previous cycle and must
not be reused. The change applies to all four callers (load-draft,
clear-cart, save-order, confirm) so the merge/confirm paths also stop
attaching to stale drafts.

Covered by a new regression test that mirrors the production setup
(matching pickup_date, draft create_date backdated 10 days).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 17:40:48 +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: scope draft lookup to active cycle window 2026-05-29 17:40:48 +02:00