← All tests

R11.5 — Bypass gate on legacy pos.order push PROD

Pre-cutover blocker: when bypass_odoo_pos=true, the legacy R5-era pos.order push queues MUST be gated off for that tenant, or every order double-books (once via pos.order, once via the close-move). 3 legacy DAOs gain an innerJoin against cafe.tenant_config with bypass_odoo_pos=false. Product/customer push queues stay open — Odoo still needs the product catalog + res.partner records for accounting reporting; just no pos.order writes. With this in place, the R11 arc is formally complete on the code side — only the operational cutover (SQL flip + Narong's shift close + 1-week accountant soak) remains.

1 cafe commit + 41/41 regression green.
No R11.5-specific prod test runs this Gate 2. The gate's effect is unobservable on prod until some tenant has bypass_odoo_pos=true, which doesn't happen until the actual cutover (operator-driven SQL flip). pos.order push path runs unchanged for all 3 tenants since bypass=false everywhere on prod. Regression-only sweep confirms the DAO change didn't break the legacy push for non-bypass tenants.

Regression sweep — sequential per R8.2 rule

SuiteResultNotes
test-launchpad-fix-prod.mjs8/8Outdoor SSO bridge fix sanity
test-r7-prod.mjs14/14Dashboard + manager-live
test-r8-prod.mjs4/4Auth/security trio
test-cash-carryover-prod.mjs9/9cafe.sessions read path
test-phase2-cafe-multishop-prod.mjs6/6Cafe multi-shop

R11 arc — code side complete

✅ R11.1 — Recon spike (read-only Odoo dump; corrected scoping memo)
✅ R11.2 — Schema (bypass flag + 3 IDs + cafe.sessions.odoo_move_id + partial index)
✅ R11.3 — Direct account.move writer + auto-provision (helpers + drain loop)
✅ R11.4 — Cross-session refund aggregator (Option B per Narong)
✅ R11.5 — Bypass gate on legacy pos.order push (this ship — blocker closed)

⏳ R11.5 cutover (operational, not code):
   - Pre-flip: SQL set 3 IDs explicitly on get-coffee
   - Flip: bypass_odoo_pos=true on get-coffee
   - Narong closes a real shift
   - wrangler tail confirms drain fires
   - Verify the account.move in Odoo backoffice
   - 1-week accountant soak
   - Rollback via flag flip if anything drifts

R11.5 cutover SQL (reference for next session)

-- Pre-populate the 3 Odoo IDs explicitly to skip lazy-resolve on first close:
UPDATE cafe.tenant_config SET
  odoo_sales_income_account_id   = 162,
  odoo_ar_pos_account_id         = 107,
  odoo_session_close_journal_id  = 48
WHERE tenant_id = (SELECT id FROM tenants WHERE code='get-coffee');

-- Flip the flag (single statement):
UPDATE cafe.tenant_config SET bypass_odoo_pos = true
WHERE tenant_id = (SELECT id FROM tenants WHERE code='get-coffee');

-- Rollback if needed:
UPDATE cafe.tenant_config SET bypass_odoo_pos = false
WHERE tenant_id = (SELECT id FROM tenants WHERE code='get-coffee');