[19.0][MIG] website_sale_carrier_auto_assign: Migration to 19.0#1257
Open
JrAdhoc wants to merge 2 commits into
Open
[19.0][MIG] website_sale_carrier_auto_assign: Migration to 19.0#1257JrAdhoc wants to merge 2 commits into
JrAdhoc wants to merge 2 commits into
Conversation
…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.
There was a problem hiding this comment.
Pull request overview
Migrates the website_sale_carrier_auto_assign glue addon to Odoo 19.0, ensuring sale_order_carrier_auto_assign does not auto-create delivery lines for website carts (avoiding duplicate delivery lines during e-commerce checkout).
Changes:
- Adds a
sale.orderoverride to disable carrier auto-assign whenwebsite_idis set. - Introduces coverage tests validating behavior for website vs backend orders and ensuring no duplicate delivery line after
_set_delivery_method. - Adds generated addon documentation/readme assets for 19.0.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| website_sale_carrier_auto_assign/models/sale_order.py | Overrides _is_auto_set_carrier_on_create to skip OCA auto-assign on website orders. |
| website_sale_carrier_auto_assign/manifest.py | Declares module metadata, dependencies, and 19.0 version. |
| website_sale_carrier_auto_assign/tests/test_website_sale_carrier_auto_assign.py | Adds regression tests for website/backend behavior and delivery-line duplication. |
| website_sale_carrier_auto_assign/tests/init.py | Loads the test module. |
| website_sale_carrier_auto_assign/static/description/index.html | Provides the generated HTML description for the addon (needs 19.0 link corrections). |
| website_sale_carrier_auto_assign/readme/DESCRIPTION.md | Adds the functional description used to generate README/description assets. |
| website_sale_carrier_auto_assign/README.rst | Adds the generated README for the addon (19.0 links). |
| website_sale_carrier_auto_assign/pyproject.toml | Adds build-system metadata for packaging. |
| website_sale_carrier_auto_assign/models/init.py | Exposes the model override. |
| website_sale_carrier_auto_assign/init.py | Initializes the addon Python package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! source digest: sha256:a9b46f72bc3da4b07f6f3b421bb0d4aa16cec7073c5f7059c3f8313a6a024168 | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> | ||
| <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/e-commerce/tree/18.0/website_sale_carrier_auto_assign"><img alt="OCA/e-commerce" src="https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_sale_carrier_auto_assign"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/e-commerce&target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p> |
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> | ||
| <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/e-commerce/tree/18.0/website_sale_carrier_auto_assign"><img alt="OCA/e-commerce" src="https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_sale_carrier_auto_assign"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/e-commerce&target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p> | ||
| <p>This module is a glue between | ||
| <a class="reference external" href="https://github.com/odoo/odoo/tree/18.0/addons/website_sale">website_sale</a> |
| <p>This module is a glue between | ||
| <a class="reference external" href="https://github.com/odoo/odoo/tree/18.0/addons/website_sale">website_sale</a> | ||
| and | ||
| <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/18.0/sale_order_carrier_auto_assign">sale_order_carrier_auto_assign</a>.</p> |
| <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/e-commerce/issues">GitHub Issues</a>. | ||
| In case of trouble, please check there if your issue has already been reported. | ||
| If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
| <a class="reference external" href="https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_carrier_auto_assign%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> |
| <p>OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
| mission is to support the collaborative development of Odoo features and | ||
| promote its widespread use.</p> | ||
| <p>This module is part of the <a class="reference external" href="https://github.com/OCA/e-commerce/tree/18.0/website_sale_carrier_auto_assign">OCA/e-commerce</a> project on GitHub.</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migration of
website_sale_carrier_auto_assignto 19.0.Glue module between
website_saleandsale_order_carrier_auto_assignthat prevents duplicate delivery lines on website orders.The 18.0 version is being added in #1248 (still under review); its
[ADD]history is preserved in this PR.No code changes were needed beyond the version bump — the overridden
_is_auto_set_carrier_on_createand the test API are compatible with 19.0. The module's tests pass on a fresh 19.0 database.