Skip to content

[OU-FIX] website_sale_collect: fix invalid SQL in pickup-address backfill - #112

Open
dnplkndll wants to merge 1 commit into
19.0from
19.0-fix-website-sale-collect-pickup-sql
Open

[OU-FIX] website_sale_collect: fix invalid SQL in pickup-address backfill#112
dnplkndll wants to merge 1 commit into
19.0from
19.0-fix-website-sale-collect-pickup-sql

Conversation

@dnplkndll

Copy link
Copy Markdown

_mark_pickup_auxiliary_addresses builds an UPDATE whose WHERE uses comma-separated conditions instead of AND (plus parent_id != False and a trailing comma) — invalid SQL that raises a syntax error as soon as a pickup carrier (delivery_type='in_store') exists. CI stays green only because the demo seed has no in_store carrier, so the loop body never executes; a real prod migration with in-store pickup would crash.

Fix: AND between conditions, IS NOT DISTINCT FROM for the nullable state_id/country_id (so pickup locations without a state/country still match), parent_id IS NOT NULL, and pass .id (not the recordset) for the relational params.

Bug originates in OCA#5740 (pedrobaeza) — worth reporting upstream.

@dnplkndll
dnplkndll force-pushed the 19.0-fix-website-sale-collect-pickup-sql branch 6 times, most recently from c58a16d to 0fda638 Compare August 5, 2026 15:21
@dnplkndll
dnplkndll force-pushed the 19.0-fix-website-sale-collect-pickup-sql branch from 0fda638 to 84d7ede Compare August 6, 2026 15:22
…fill

_mark_pickup_auxiliary_addresses built an UPDATE whose WHERE used
comma-separated conditions instead of AND (plus `parent_id != False` and a
trailing comma) — invalid SQL that raises syntax error the moment a pickup
carrier (delivery_type='in_store') exists. CI is green only because the demo
seed has no in_store carrier, so the loop never runs. Use AND, IS NOT DISTINCT
FROM for the nullable state_id/country_id (matches pickup locations without a
state/country), parent_id IS NOT NULL, and pass .id (not the recordset) for the
relational params. Bug from OCA#5740 (pedrobaeza).
@dnplkndll
dnplkndll force-pushed the 19.0-fix-website-sale-collect-pickup-sql branch from 84d7ede to 44ca4b8 Compare August 7, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant