OCA / stock-logistics-barcode

https://odoo-community.org/psc-teams/logistics-18
GNU Affero General Public License v3.0
158 stars 324 forks source link

AttributeError: module 'barcode' has no attribute 'get_barcode_class' #556

Open lgrijalvah opened 9 months ago

lgrijalvah commented 9 months ago

Module

barcodes_generator_product

Describe the bug

Used tu work, lately this error appear at clicking "Generate Barcode" button: RPC_ERROR Odoo Server Error Traceback (most recent call last): File "/odoo16/odoo16-server/odoo/http.py", line 1589, in _serve_db return service_model.retrying(self._serve_ir_http, self.env) File "/odoo16/odoo16-server/odoo/service/model.py", line 133, in retrying result = func() File "/odoo16/odoo16-server/odoo/http.py", line 1616, in _serve_ir_http response = self.dispatcher.dispatch(rule.endpoint, args) File "/odoo16/odoo16-server/odoo/http.py", line 1820, in dispatch result = self.request.registry['ir.http']._dispatch(endpoint) File "/odoo16/odoo16-server/addons/website/models/ir_http.py", line 237, in _dispatch response = super()._dispatch(endpoint) File "/odoo16/odoo16-server/odoo/addons/base/models/ir_http.py", line 154, in _dispatch result = endpoint(request.params) File "/odoo16/odoo16-server/odoo/http.py", line 697, in route_wrapper result = endpoint(self, *args, *params_ok) File "/odoo16/odoo16-server/addons/web/controllers/dataset.py", line 46, in call_button action = self._call_kw(model, method, args, kwargs) File "/odoo16/odoo16-server/addons/web/controllers/dataset.py", line 33, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/odoo16/odoo16-server/odoo/api.py", line 466, in call_kw result = _call_kw_multi(method, model, args, kwargs) File "/odoo16/odoo16-server/odoo/api.py", line 453, in _call_kw_multi result = method(recs, args, kwargs) File "/odoo16/custom/oca/stock-logistics-barcode/barcodes_generator_product/models/product_template.py", line 68, in generate_barcode self.product_variant_ids.generate_barcode() File "/odoo16/custom/oca/stock-logistics-barcode/barcodes_generator_abstract/models/barcode_generate_mixin.py", line 80, in generate_barcode barcode_class = barcode.get_barcode_class(item.barcode_rule_id.encoding) AttributeError: module 'barcode' has no attribute 'get_barcode_class'

The above server error caused the following client error: RPC_ERROR: Odoo Server Error RPCError@https://www.(ODOOSERVERADDRESS)/web/assets/debug/web.assets_backend.js:10377:14 makeErrorFromResponse@https://www.(ODOOSERVERADDRESS)/web/assets/debug/web.assets_backend.js:10400:31 @https://www.(ODOOSERVERADDRESS)/web/assets/debug/web.assets_backend.js:10453:48

To Reproduce

Working on ODOO16 Community,

Steps to reproduce the behavior:

  1. Select product
  2. Select Barcode Rule Rule
  3. Click on Generate Base
  4. Click on Generate Barcode

Expected behavior Barcode should be generated according to barcode rule and its corresponding sequence, instead, a Warning popup window appear with the described error

legalsylvain commented 9 months ago

Hi. Thanks for reporting. Could you reproduce the bug on runboat and let me know ? thanks !

Rom10811 commented 6 months ago

Hello Sylvain, The bug still exists in version 16 on runboat, on a version 14 environment the code is the same but the bug doesn't exist Thanks

legalsylvain commented 6 months ago

Hi. I don't understand. Just ran the last runboat.

http://oca-stock-logistics-barcode-16-0-90c4dba98029.runboat.odoo-community.org/web#id=16&cids=1&menu_id=112&action=249&model=product.product&view_type=form

It works.

image

could you provide the url of the runboat instance where it is failing ? thanks !