OCA / sale-workflow

Odoo Sales, Workflow and Organization
GNU Affero General Public License v3.0
295 stars 1.03k forks source link

[13.0] sale_manual_delivery - Error:odoo.exceptions.CacheMiss: ('sale.order.line(554,).qty_procured', None) #1619

Closed QuiJoQuim closed 1 year ago

QuiJoQuim commented 3 years ago

When a public user is trying to validate a cart sometimes (only sometimes) got an AccessError to get access to sale.order.lines:

  File "/opt/odoo13/odoo/odoo/api.py", line 745, in get
    value = self._data[field][record._ids[0]]
KeyError: 554

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo13/odoo/odoo/fields.py", line 1037, in __get__
    value = env.cache.get(record, self)
  File "/opt/odoo13/odoo/odoo/api.py", line 751, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('sale.order.line(554,).qty_procured', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo13/odoo/odoo/fields.py", line 1044, in __get__
    recs._fetch_field(self)
  File "/opt/odoo13/odoo/odoo/models.py", line 2994, in _fetch_field
    self._read(fnames)
  File "/opt/odoo13/odoo/odoo/models.py", line 3110, in _read
    raise self.env['ir.rule']._make_access_error('read', forbidden)
odoo.exceptions.AccessError: ('La operación solicitada no puede completarse debido a restricciones de seguridad. Por favor contacte a su administrador.\n\n(Tipo de documento: "Línea de pedido de venta" (sale.order.line), Operación: read)', None)

This is caused by an error on CacheMiss: ('sale.order.line(554,).qty_procured', None).

As seen on similar errors it's caused by non initialitzation of a stored calculated field (in this case "qty:procured")

github-actions[bot] commented 1 year ago

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.