Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] #11337 access problem on ir.config.parameter when editing product #41

Merged

Conversation

thomaspaulb
Copy link
Contributor

@thomaspaulb thomaspaulb commented Jan 9, 2025

Traceback (most recent call last):
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/api.py", line 997, in get
    cache_value = field_cache[record._ids[0]]
KeyError: 4039
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/fields.py", line 1161, in __get__
    value = env.cache.get(record, self)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/api.py", line 1004, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: 'product.template(4039,).barcode'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/fields.py", line 1210, in __get__
    self.compute_value(recs)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/fields.py", line 1392, in compute_value
    records._compute_field_value(self)
  File "/home/ubuntu/odoo/auto/addons/mail/models/mail_thread.py", line 403, in _compute_field_value
    return super()._compute_field_value(field)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/models.py", line 4259, in _compute_field_value
    fields.determine(field.compute, self)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/fields.py", line 98, in determine
    return needle(*args)
  File "/home/ubuntu/odoo/auto/addons/product_digi_sync/models/product_template.py", line 38, in _compute_barcode
    current_rule = record.get_current_barcode_rule()
  File "/home/ubuntu/odoo/auto/addons/product_digi_sync/models/product_template.py", line 28, in get_current_barcode_rule
    weighted_barcode_rule = self._get_barcode_rule("weighted_barcode_rule_id")
  File "/home/ubuntu/odoo/auto/addons/product_digi_sync/models/product_template.py", line 73, in _get_barcode_rule
    barcode_rule_id = self.env["ir.config_parameter"].get_param(rule_id)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/addons/base/models/ir_config_parameter.py", line 68, in get_param
    self.check_access_rights('read')
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/models.py", line 3498, in check_access_rights
    return self.env['ir.model.access'].check(self._name, operation, raise_exception)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/addons/base/models/ir_model.py", line 1935, in check
    raise AccessError(msg)
odoo.exceptions.AccessError: You are not allowed to access 'System Parameter' (ir.config_parameter) records.
This operation is allowed for the following groups:
	- Administration/Settings
Contact your administrator to request access if necessary.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/http.py", line 1653, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/service/model.py", line 133, in retrying
    result = func()
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/http.py", line 1680, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/http.py", line 1884, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/addons/base/models/ir_http.py", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/http.py", line 734, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/home/ubuntu/odoo/auto/addons/web/controllers/dataset.py", line 42, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/ubuntu/odoo/auto/addons/web/controllers/dataset.py", line 33, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/api.py", line 468, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/api.py", line 453, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/models.py", line 3021, in read
    return self._read_format(fnames=fields, load=load)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/models.py", line 3202, in _read_format
    vals[name] = convert(record[name], record, use_name_get)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/models.py", line 5975, in __getitem__
    return self._fields[key].__get__(self, self.env.registry[self._name])
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/fields.py", line 1212, in __get__
    self.compute_value(record)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/fields.py", line 1392, in compute_value
    records._compute_field_value(self)
  File "/home/ubuntu/odoo/auto/addons/mail/models/mail_thread.py", line 403, in _compute_field_value
    return super()._compute_field_value(field)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/models.py", line 4259, in _compute_field_value
    fields.determine(field.compute, self)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/fields.py", line 98, in determine
    return needle(*args)
  File "/home/ubuntu/odoo/auto/addons/product_digi_sync/models/product_template.py", line 38, in _compute_barcode
    current_rule = record.get_current_barcode_rule()
  File "/home/ubuntu/odoo/auto/addons/product_digi_sync/models/product_template.py", line 28, in get_current_barcode_rule
    weighted_barcode_rule = self._get_barcode_rule("weighted_barcode_rule_id")
  File "/home/ubuntu/odoo/auto/addons/product_digi_sync/models/product_template.py", line 73, in _get_barcode_rule
    barcode_rule_id = self.env["ir.config_parameter"].get_param(rule_id)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/addons/base/models/ir_config_parameter.py", line 68, in get_param
    self.check_access_rights('read')
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/models.py", line 3498, in check_access_rights
    return self.env['ir.model.access'].check(self._name, operation, raise_exception)
  File "/home/ubuntu/odoo/custom/src/odoo/odoo/addons/base/models/ir_model.py", line 1935, in check
    raise AccessError(msg)
odoo.exceptions.AccessError: You are not allowed to access 'System Parameter' (ir.config_parameter) records.
This operation is allowed for the following groups:
	- Administration/Settings
Contact your administrator to request access if necessary.

@jurcello jurcello merged commit 6c7570d into Gedeelde-Weelde:16.0 Jan 9, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants