To reproduce the issue:
(Need stock_barcode)
1. Create a product:
- Barcode: 1234567890123
2. Print the label
3. Try to scan the barcode and check the value read.
Error: The value is 1234567890128, the last digit is incorrect (8
instead of 3)
When printing a barcode, we use the library 'report-lab' to generate a
barcode image from a value and a barcode type. In case of EAN-13, if the
value contains a non-digit character, it will raise an error. We then
catch the error and retry to generate the barcode according to the
barcode type Code128:
https://github.com/odoo/odoo/blob/87698d90f02bfe93c6e643f4876a5ccd74788eff/odoo/addons/base/models/ir_actions_report.py#L569-L575
However, if the value contains only digits, the method will use the 12
first digits:
https://github.com/mattjmorrison/ReportLab/blob/dade0f303cb6fcdbe535c4cc92e6102c2417b699/src/reportlab/graphics/barcode/eanbc.py#L187-L188
and will then add the last one, the check digit, which is computed by
the library. This explains why, in the above use case, the barcode value
returned by the scanner is not the same than the expected one.
Note: Similar behavior with type EAN-8
OPW-2902150
closes odoo/odoo#97052
X-original-commit: a2c7470f8fd46b2520f7b8f0750c63216273ce96
Related: odoo/enterprise#30160
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
56 lines
1.5 KiB
Python
56 lines
1.5 KiB
Python
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from . import common
|
|
from . import test_acl
|
|
from . import test_api
|
|
from . import test_barcode
|
|
from . import test_base
|
|
from . import test_basecase
|
|
from . import test_cache
|
|
from . import test_deprecation
|
|
from . import test_db_cursor
|
|
from . import test_expression
|
|
from . import test_float
|
|
from . import test_func
|
|
from . import test_http_case
|
|
from . import test_image
|
|
from . import test_avatar_mixin
|
|
from . import test_ir_actions
|
|
from . import test_ir_attachment
|
|
from . import test_ir_cron
|
|
from . import test_ir_filters
|
|
from . import test_ir_mail_server
|
|
from . import test_ir_model
|
|
from . import test_ir_sequence
|
|
from . import test_ir_sequence_date_range
|
|
from . import test_ir_default
|
|
from . import test_mail
|
|
from . import test_menu
|
|
from . import test_mimetypes
|
|
from . import test_misc
|
|
from . import test_module
|
|
from . import test_orm
|
|
from . import test_ormcache
|
|
from . import test_osv
|
|
from . import test_qweb_field
|
|
from . import test_qweb
|
|
from . import test_res_config
|
|
from . import test_res_lang
|
|
from . import test_search
|
|
from . import test_translate
|
|
#import test_uninstall # loop
|
|
from . import test_user_has_group
|
|
from . import test_views
|
|
from . import test_xmlrpc
|
|
from . import test_res_partner
|
|
from . import test_res_partner_bank
|
|
from . import test_res_users
|
|
from . import test_reports
|
|
from . import test_test_retry
|
|
from . import test_test_suite
|
|
from . import test_tests_tags
|
|
from . import test_form_create
|
|
from . import test_cloc
|
|
from . import test_profiler
|
|
from . import test_pdf
|