a2f985a84d227f6fc7c39cba4e9904138522fd10
Since https://github.com/odoo/odoo/pull/104287 the GS1 separator defined in the nomenclature is no more used in `BarcodeParser` `gs1_decompose_extanded` but it is used in `barcodeService` `cleanBarcode` instead. The issue with that is `cleanBarcode` is not called in every case. It will if the barcode is actually scanned but it won't if the barcode is decoded from a picture (using the device's camera) or triggered through an event directly (thanks to the debug console and the manual entry available in the Barcode App.) That means if we want to support custom separators, we have to clean the barcode also in `parse_gs1_rule_pattern`. How to reproduce: - Activate `stock_barcode` and chose the GS1 nomenclature; - Create a product and set a valid barcode (right checksum, eg.: 00000000012348); - In the Barcode App, create a new receipt and scan a GS1 barcode for this product containing also a quantity and using a custom separator (`#` can be use aswell by default, eg.: 3008#0100000000012348 for 8x this product) with using the device camera or by trigger the event through the console: odoo.__WOWL_DEBUG__.root.env.services.barcode.bus.trigger( "barcode_scanned", { barcode: "3008#0100000000012348" }, ); -> Issue: the barcode is not recognized. With this commit, the parser will get the nomenclature's separator and will use it like before in `gs1_decompose_extanded`. Also, this commit slightly changes the separator regex (from '\x1D?' to '(?:\x1D+)?') in case multiple separators follow each other. OPW-3439905 closes odoo/odoo#138420 X-original-commit: 39ecbf9d93d465533619aa32e127331a0307c3a9 Related: odoo/enterprise#48811 Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com> Signed-off-by: Steve Van Essche <svs@odoo.com>
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%