Skip to content

[19.0][MIG] pos_order_to_sale_order - #1587

Open
symbiotech wants to merge 95 commits into
OCA:19.0from
symbiotech:19.0-mig-pos_order_to_sale_order-symbiotech
Open

[19.0][MIG] pos_order_to_sale_order#1587
symbiotech wants to merge 95 commits into
OCA:19.0from
symbiotech:19.0-mig-pos_order_to_sale_order-symbiotech

Conversation

@symbiotech

Copy link
Copy Markdown

Summary

  • Continues the 19.0 migration of pos_order_to_sale_order from [19.0][MIG] pos_order_to_sale_order #1484
  • Fixes CI by updating POS tour helper imports to Odoo 19 paths (tests/pos/tours/utils, tests/generic_helpers)
  • Restores is_storable on tour products so delivery/invoice assertions can pass

Context

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

  • Wait for OCA CI (test with Odoo / test with OCB / pre-commit) to turn green
  • Confirm tour PosOrderToSaleOrderTour creates an invoiced sale order
  • Functional check: Create Order → Create Invoiced Sale Order from POS
  • Close or supersede [19.0][MIG] pos_order_to_sale_order #1484 once this is ready to merge

legalsylvain and others added 30 commits February 4, 2026 11:27
* [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
…) 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/
glitchov and others added 3 commits February 4, 2026 11:28
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>
Copilot AI review requested due to automatic review settings July 22, 2026 07:39
@OCA-git-bot OCA-git-bot added series:19.0 mod:pos_order_to_sale_order Module pos_order_to_sale_order labels Jul 22, 2026
Cashiers often lack Sales ACL; create_order_from_pos must elevate.

Refs OCA#1484

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread pos_order_to_sale_order/tests/test_module.py
Comment thread pos_order_to_sale_order/readme/DESCRIPTION.md Outdated
symbiotech and others added 3 commits July 22, 2026 09:47
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 37 changed files in this pull request and generated 2 comments.

Comment thread pos_order_to_sale_order/models/sale_order.py Outdated
Comment thread pos_order_to_sale_order/tests/test_module.py Outdated
symbiotech and others added 4 commits July 22, 2026 10:48
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 37 changed files in this pull request and generated 3 comments.

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
symbiotech and others added 2 commits July 22, 2026 11:16
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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 37 changed files in this pull request and generated 2 comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:pos_order_to_sale_order Module pos_order_to_sale_order series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.