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.

…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).
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