odoo/odoo#203314
Created by Bugfix, Adrien Widart (awt)
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: Contact runbot team on discord for help.
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- label
- odoo-dev:saas-17.4-OPW-4474214-point_of_sale_combo-awt
- head
- ee10eadb035b88847cf465de5fa0c477f7e4a058
- merged
- 7 months ago by POS IoT, Joseph Caburnay (jcb)
| odoo/odoo | |
|---|---|
| saas-17.4 | #203314 |
| 18.0 | #205051 |
| saas-18.1 | #205223 |
| saas-18.2 | #205411 |
| saas-18.3 | |
| saas-18.4 | |
| 19.0 | |
| master | #205432 |
[FIX] point_of_sale: scan combo
It is currently not possible to scan a combo.
To reproduce the issue:
(Use demo data)
1. Point of Sale > Products > Product Variantes, edit Office Combo
- Add a barcode
2. Start the PoS Furniture Shop
3. Scan the barcode
Error: a line is added on the left-side panel. Scanning the combo
should actually open a popup so that the PoS user can select the
products.
About the behaviour: since [1], the barcode field is invisible on
the template form of a combo. It is even mentioned on the excalidraw.
However, the field is still visible on all other views. Moreover,
there isn't any constraint or anything to prevent such a template
from having a barcode. Discussed with the PO, for spec clarifications:
> Scanning a combo wasn't really planned in the first place.
> I can imagine the case where they print the barcodes on the side.
> It's OK if it's scannable, but that doesn't mean we should make
> the field visible
About the issue: quite simple, when scanning the barcode, it leads to
https://github.com/odoo/odoo/blob/6a6b70c9bf2420380ae91ca8f5b21f2bfbc1a5b9/addons/point_of_sale/static/src/app/screens/product_screen/product_screen.js#L209-L213
Where the third argument is false, cf needToConfigure:
https://github.com/odoo/odoo/blob/7a2923af64bd196a8271af4c99a37ac8ce3e15f8/addons/point_of_sale/static/src/app/models/product_product.js#L39-L49
The call to addLineToCurrentOrder will lead to addLineToOrder,
where the parameter configure is false (as explained just above).
As a result, even if the product is correctly identified as a combo,
we don't open the popup
https://github.com/odoo/odoo/blob/14d51bd960d7dd49cb234722b7725b98549feb04/addons/point_of_sale/static/src/app/store/pos_store.js#L735-L742
Taking the configure parameter doesn't seem to make sense with
combo products, as these ones always stand for some other products
that the user should select.