Skip to content

[19.0][MIG] pos_sale_picking_keep#1576

Open
alan196 wants to merge 10 commits into
OCA:19.0from
Jarsa-dev:19.0-mig-pos_sale_picking_keep
Open

[19.0][MIG] pos_sale_picking_keep#1576
alan196 wants to merge 10 commits into
OCA:19.0from
Jarsa-dev:19.0-mig-pos_sale_picking_keep

Conversation

@alan196

@alan196 alan196 commented Jun 27, 2026

Copy link
Copy Markdown

Migration of pos_sale_picking_keep from 18.0 to 19.0.

Migration changes

  • Bump manifest version to 19.0.1.0.0.
  • Update the PoS test tour imports to the new 19.0 paths (tests/pos/tours/utils/* and tests/generic_helpers/dialog_util).
  • Grant sales_team.group_sale_salesman in the test setup: in 19.0 point_of_sale.group_pos_manager no longer implies sales rights and the web onchange now checks create access, so creating the sale order in the test raised AccessError.
  • Use f-strings for the tour URLs (ruff UP031).
  • Add readme/CONTRIBUTORS.md and regenerate the README.

Functional behavior is unchanged; both PoS tours pass locally.

cc @pedrobaeza

pedrobaeza and others added 7 commits June 26, 2026 19:12
This module inhibits the manipulation that the point of sale mades over
the sales orders pickings, and the creation of new pickings under the
PoS picking type.

Use Cases / Context
===================

In some scenarios, you may not want that the point of sale (PoS) handles
the pickings of the products you are paying:

- Using the PoS as a pure payment terminal.
- When complex stock flows are not supplied by the PoS.

In that cases, it's better to keep the original sales pickings.
Currently translated at 100.0% (3 of 3 strings)

Translation: pos-18.0/pos-18.0-pos_sale_picking_keep
Translate-URL: https://translation.odoo-community.org/projects/pos-18-0/pos-18-0-pos_sale_picking_keep/it/
If you have previously sync a `pos.order` (for example, because you have
gone to backend with an opened order), and later you do things like
unlinking an existing line, you may find other kind of commands in
`lines` dictionary like `(2, <id>)`, making the code of this module to
crash, so let's protect it properly.
- Bump manifest version to 19.0.1.0.0.
- Add sale_stock dependency: pos_sale loads sale.order.picking_ids in the
  PoS data, a field provided by sale_stock. It is auto_install so it is
  normally present, but it is not pulled in the minimal CI install, which
  made the PoS fail to load with 'Invalid field picking_ids on sale.order'.
  The module also operates on the sale order stock moves/pickings, so the
  dependency is required.
- Update the PoS test tour imports to the new 19.0 paths
  (tests/pos/tours/utils and generic_helpers).
- Grant the sales user group in tests, as point_of_sale.group_pos_manager
  no longer implies sales rights and the onchange now checks create access.
- Use f-strings for the tour URLs (ruff UP031).
- Add CONTRIBUTORS and regenerate README.
@alan196

alan196 commented Jun 27, 2026

Copy link
Copy Markdown
Author

ℹ️ Tests pass (tour SUCCEEDED, 0 failed, 0 error(s)). CI is red only because of the Chrome teardown WARNING (Killing chrome descendants-or-self ... chrome (zombie)) that checklog-odoo flags, which affects every PR with a tour in this repo. The infra fix is in #1577; once merged, this PR will go green when re-run on the updated base.

When settling a sale order, the PoS deducts the already delivered
quantity from each line, because it assumes it will deliver the
remaining quantity itself. With this module the sale order pickings are
kept and the PoS is only used to charge the order, so lines of already
delivered orders were loaded with zero quantity (or even removed for
products whose UoM is not groupable in the PoS, due to the line
splitting logic of pos_sale).

Load the ordered quantity instead, deducting only the quantity already
invoiced to avoid charging twice.
@alan196

alan196 commented Jul 2, 2026

Copy link
Copy Markdown
Author

Added a second commit with an improvement found while using the module in production: when settling a sale order that was already delivered, the PoS loaded the lines with zero quantity (or even dropped the lines completely for products whose UoM is not groupable in the PoS, due to the line splitting logic of pos_sale). Since with this module the PoS is only used to charge the order and the sale order pickings are kept, the ordered quantity is now loaded, deducting only what was already invoiced. Covered with a new tour-based test.

When settling a sale order whose line UoM differs from the product base
UoM, read_converted converts the quantity to the product UoM without
rounding, but the PoS rounds it afterwards with the Product Unit
precision. When the converted quantity is not representable with that
precision (e.g. 4 Units of a pack of 150 = 0.02666 packs, rounded to
0.03 by the PoS), the customer was charged for the rounded quantity
(0.03 * 984.00 = 29.52 instead of 4 * 6.56 = 26.24).

Compensate the price returned to the PoS so that the rounded quantity
times the price matches the sale order line remaining amount.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:pos_sale_picking_keep Module pos_sale_picking_keep series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants