[19.0][MIG] pos_order_to_sale_order - #1587
Open
symbiotech wants to merge 95 commits into
Open
Conversation
* [ADD] new module pos_order_to_sale_order
…ion of this module (price unit loss, and pricelist) if pos_pricelist is installed
[FIX] Remove console.log ; [IMP] Do not import js files in backend [IMP] apply new readme structure [FIX] remove useless demo file [FIX] some pylint issues [REF] add maintainers and developpment status
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: pos-8.0/pos-8.0-pos_order_to_sale_order Translate-URL: https://translation.odoo-community.org/projects/pos-8-0/pos-8-0-pos_order_to_sale_order/
Co-authored-by: Iván Todorovich <ivan.todorovich@druidoo.io>
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: pos-12.0/pos-12.0-pos_order_to_sale_order Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_order_to_sale_order/
Currently translated at 100.0% (23 of 23 strings) Translation: pos-12.0/pos-12.0-pos_order_to_sale_order Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_order_to_sale_order/es/
Currently translated at 100.0% (23 of 23 strings) Translation: pos-12.0/pos-12.0-pos_order_to_sale_order Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_order_to_sale_order/pt_BR/
Return module's javascript widgets to make them extendable for other modules. Same idea as OCA#535
…quired in recent odoo version
…) is null, that occures if pos_restaurant is installed
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: pos-12.0/pos-12.0-pos_order_to_sale_order Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_order_to_sale_order/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: pos-12.0/pos-12.0-pos_order_to_sale_order Translate-URL: https://translation.odoo-community.org/projects/pos-12-0/pos-12-0-pos_order_to_sale_order/
Tour helpers moved under tests/pos/ and generic_helpers. Restore is_storable so delivery assertions still pass. Refs OCA#1484 Co-authored-by: Cursor <cursoragent@cursor.com>
Cashiers often lack Sales ACL; create_order_from_pos must elevate. Refs OCA#1484 Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
Continues the Odoo 19.0 migration of pos_order_to_sale_order by reintroducing the POS UI flow to create a Sale Order from a draft POS order (with draft/confirmed/delivered/invoiced variants), plus updated tours/tests and regenerated addon documentation.
Changes:
- Adds POS frontend components (control button + popup) to trigger
sale.order.create_order_from_pos. - Adds backend preparation/creation logic on
sale.order/sale.order.line, plus POS configuration flags and Settings view. - Adds a web tour + Python UI test and refreshes addon readme/description/i18n artifacts.
Reviewed changes
Copilot reviewed 32 out of 36 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| pos_order_to_sale_order/init.py | Initializes addon Python package. |
| pos_order_to_sale_order/manifest.py | Declares addon metadata, dependencies, and JS/XML assets (POS + tests). |
| pos_order_to_sale_order/i18n/ca.po | Adds/updates Catalan translations for new UI strings. |
| pos_order_to_sale_order/i18n/es.po | Adds/updates Spanish translations for new UI strings. |
| pos_order_to_sale_order/i18n/fr.po | Adds/updates French translations for new UI strings. |
| pos_order_to_sale_order/i18n/it.po | Adds/updates Italian translations for new UI strings. |
| pos_order_to_sale_order/i18n/pos_order_to_sale_order.pot | Regenerated translation template for extracted strings. |
| pos_order_to_sale_order/i18n/pt_BR.po | Adds/updates Brazilian Portuguese translations for new UI strings. |
| pos_order_to_sale_order/models/init.py | Exposes model extensions for loading by Odoo. |
| pos_order_to_sale_order/models/pos_config.py | Adds POS config toggles controlling which SO-creation options are available. |
| pos_order_to_sale_order/models/res_config_settings.py | Exposes POS config toggles in Settings via related fields. |
| pos_order_to_sale_order/models/sale_order.py | Implements create_order_from_pos and mapping from POS payload to Sale Order. |
| pos_order_to_sale_order/models/sale_order_line.py | Builds SO line values from POS payload and appends customer notes in descriptions. |
| pos_order_to_sale_order/pyproject.toml | Declares build-system metadata for the addon package. |
| pos_order_to_sale_order/readme/CONFIGURE.md | Adds configuration instructions used by generated README. |
| pos_order_to_sale_order/readme/CONTRIBUTORS.md | Adds contributors list used by generated README. |
| pos_order_to_sale_order/readme/DESCRIPTION.md | Adds functional description used by generated README (source). |
| pos_order_to_sale_order/readme/DEVELOP.md | Adds developer notes used by generated README (source). |
| pos_order_to_sale_order/readme/USAGE.md | Adds user-facing usage instructions used by generated README (source). |
| pos_order_to_sale_order/README.rst | Generated README containing usage/config/development docs. |
| pos_order_to_sale_order/static/description/index.html | Generated HTML description for the Apps page. |
| pos_order_to_sale_order/static/src/components/control_buttons/control_buttons.esm.js | Patches POS ControlButtons component registry to include CreateOrderButton. |
| pos_order_to_sale_order/static/src/components/control_buttons/control_buttons.xml | Extends POS ControlButtons template to render CreateOrderButton. |
| pos_order_to_sale_order/static/src/components/create_order_button/create_order_button.esm.js | Implements the Create Order POS control button behavior and enabling rules. |
| pos_order_to_sale_order/static/src/components/create_order_button/create_order_button.xml | Defines the Create Order control button template. |
| pos_order_to_sale_order/static/src/components/create_order_popup/create_order_popup.esm.js | Implements the popup actions and ORM call to create the Sale Order. |
| pos_order_to_sale_order/static/src/components/create_order_popup/create_order_popup.xml | Defines the popup UI with multiple create-order options based on config. |
| pos_order_to_sale_order/static/tests/tours/helpers/PosOrderToSaleOrderMethods.esm.js | Adds tour helper methods to click the new controls. |
| pos_order_to_sale_order/static/tests/tours/PosOrderToSaleOrderTour.tour.esm.js | Adds a POS tour exercising invoiced SO creation flow. |
| pos_order_to_sale_order/tests/init.py | Loads Python tests module. |
| pos_order_to_sale_order/tests/test_module.py | Adds frontend tour-based test asserting SO creation + delivered/invoiced state. |
| pos_order_to_sale_order/views/view_res_config_settings.xml | Adds Settings UI block to configure SO-creation options for POS. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Apply valid review notes (@Odoo-Module, assert msgs, a11y, typos) and ignore chrome zombie teardown warning that fails checklog. Refs OCA#1484 Co-authored-by: Cursor <cursoragent@cursor.com>
Refs OCA#1484 Co-authored-by: Cursor <cursoragent@cursor.com>
Refs OCA#1484 Co-authored-by: Cursor <cursoragent@cursor.com>
create_order_from_pos is a public RPC that sudo()s to bypass Sales ACLs for cashiers. Without checks, any caller who can reach call_kw could force draft/confirm/deliver/invoice with elevated rights. Before elevating, require: - a customer on the payload - an open POS session readable by the current user - action allowed by that config's iface_create_* flags Refs OCA#1484 Co-authored-by: Cursor <cursoragent@cursor.com>
serializeForORM() returns x2many sync commands, not a plain line list. CREATE (0) carries full vals; UPDATE/DELETE are partial or empty. Treating every command as a new SO line breaks once a draft POS order (or its lines) was synced: qty edits become bogus creates, deletes KeyError / invent junk lines, and customer-note sequence matching drifts. Keep Command.CREATE payloads only when mapping POS -> sale.order. Refs OCA#1484 Co-authored-by: Cursor <cursoragent@cursor.com>
delivered/invoiced actions only set move qty then call button_validate(). On lots, serials, or backorder policies, validate often returns a wizard action instead of finishing, so pickings stay open and invoice/delivery status assertions fail. Set quantities, mark moves picked, validate with skip_backorder, and process any leftover wizard so Create Delivered/Invoiced finishes. Refs OCA#1484 Co-authored-by: Cursor <cursoragent@cursor.com>
Exact float equality on monetary totals is flaky when tax/currency rounding differs slightly across environments. Use assertAlmostEqual(..., places=2) instead. Refs OCA#1484 Co-authored-by: Cursor <cursoragent@cursor.com>
Refs OCA#1484 Co-authored-by: Cursor <cursoragent@cursor.com>
Comment on lines
+10
to
+15
| <i | ||
| class="fa fa-file-text me-1" | ||
| role="img" | ||
| aria-label="Create Order" | ||
| title="Create Order" | ||
| /> |
Comment on lines
+5
to
+6
| from odoo import api, models | ||
| from odoo.fields import Command |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Import Command from odoo like sale_order.py - Mark Create Order icon decorative (aria-hidden); button text is enough for a11y and avoids hardcoded aria-label/title Refs OCA#1484 Co-authored-by: Cursor <cursoragent@cursor.com>
8 tasks
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.
Summary
pos_order_to_sale_orderfrom [19.0][MIG] pos_order_to_sale_order #1484tests/pos/tours/utils,tests/generic_helpers)is_storableon tour products so delivery/invoice assertions can passContext
Supersedes / continues work from #1484 (author: @glitchov). That PR had red CI on
test with Odoo/test with OCB; logs were expired, so this PR applies the likely fixes and re-runs CI.Test plan
test with Odoo/test with OCB/ pre-commit) to turn greenPosOrderToSaleOrderTourcreates an invoiced sale order