Skip to content

[18.0][ADD] website_sale_carrier_auto_assign: glue module to prevent duplic…#1248

Open
lef-adhoc wants to merge 1 commit into
OCA:18.0from
adhoc-dev:18.0-h-120517-lef
Open

[18.0][ADD] website_sale_carrier_auto_assign: glue module to prevent duplic…#1248
lef-adhoc wants to merge 1 commit into
OCA:18.0from
adhoc-dev:18.0-h-120517-lef

Conversation

@lef-adhoc

Copy link
Copy Markdown
Contributor

…ate delivery lines

When sale_order_carrier_auto_assign (OCA) is installed with carrier_on_create=True, its create/write overrides auto-create a delivery line from the shipping partner's property_delivery_carrier_id. On website orders, website_sale already handles carrier selection via _get_preferred_delivery_method + _set_delivery_method, so the OCA auto-assign runs in parallel and produces two delivery lines, causing:

ValueError: Expected singleton: sale.order.line(N, M)

in website_sale order_2_return_dict at checkout confirmation.

This glue module overrides _is_auto_set_carrier_on_create to return False when website_id is set, so the OCA logic is skipped for e-commerce carts while backend orders continue to work normally.

…ate delivery lines

When sale_order_carrier_auto_assign (OCA) is installed with carrier_on_create=True,
its create/write overrides auto-create a delivery line from the shipping partner's
property_delivery_carrier_id. On website orders, website_sale already handles
carrier selection via _get_preferred_delivery_method + _set_delivery_method, so the
OCA auto-assign runs in parallel and produces two delivery lines, causing:

  ValueError: Expected singleton: sale.order.line(N, M)

in website_sale order_2_return_dict at checkout confirmation.

This glue module overrides _is_auto_set_carrier_on_create to return False when
website_id is set, so the OCA logic is skipped for e-commerce carts while backend
orders continue to work normally.
@OCA-git-bot OCA-git-bot added series:18.0 mod:website_sale_carrier_auto_assign Module website_sale_carrier_auto_assign labels Jun 16, 2026
@lef-adhoc lef-adhoc changed the title [ADD] website_sale_carrier_auto_assign: glue module to prevent duplic… [18.0][ADD] website_sale_carrier_auto_assign: glue module to prevent duplic… Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:website_sale_carrier_auto_assign Module website_sale_carrier_auto_assign series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants