[19.0][MIG] pos_sale_picking_keep#1576
Conversation
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.
3fae09a to
c262e7f
Compare
|
ℹ️ Tests pass ( |
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.
|
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 |
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.
Migration of
pos_sale_picking_keepfrom 18.0 to 19.0.Migration changes
19.0.1.0.0.tests/pos/tours/utils/*andtests/generic_helpers/dialog_util).sales_team.group_sale_salesmanin the test setup: in 19.0point_of_sale.group_pos_managerno longer implies sales rights and the webonchangenow checkscreateaccess, so creating the sale order in the test raisedAccessError.ruffUP031).readme/CONTRIBUTORS.mdand regenerate the README.Functional behavior is unchanged; both PoS tours pass locally.
cc @pedrobaeza