OCA / server-tools

Tools for Odoo Administrators to improve some technical features on Odoo.
https://odoo-community.org/psc-teams/tools-30
GNU Affero General Public License v3.0
705 stars 1.5k forks source link

[13.0][BUG] auditlog - KeyError in self.pool._auditlog_model_cache on unlink of multiple o2m records #2099

Open vbezl opened 3 years ago

vbezl commented 3 years ago

Hi everyone, I have an the following error:

Error:
Odoo Server Error

Traceback (most recent call last):
  File "/opt/odoo13/odoo/odoo/http.py", line 624, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo13/odoo/odoo/http.py", line 310, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/opt/odoo13/odoo/odoo/tools/pycompat.py", line 14, in reraise
    raise value
  File "/opt/odoo13/odoo/odoo/http.py", line 669, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo13/odoo/odoo/http.py", line 350, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo13/odoo/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo13/odoo/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo13/odoo/odoo/http.py", line 915, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo13/odoo/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo13/odoo/addons/web/controllers/main.py", line 1343, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "/opt/odoo13/odoo/addons/web/controllers/main.py", line 1331, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/opt/odoo13/odoo/odoo/api.py", line 387, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/opt/odoo13/odoo/odoo/api.py", line 374, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/opt/odoo13/odoo-oca/payroll/payroll/models/hr_payslip.py", line 307, in compute_sheet
    payslip.line_ids.unlink()
  File "/opt/odoo13/odoo-oca/server-tools/auditlog/models/rule.py", line 435, in unlink_fast
    {"log_type": log_type},
  File "/opt/odoo13/odoo-oca/server-tools/auditlog/models/rule.py", line 467, in create_logs
    "model_id": self.pool._auditlog_model_cache[res_model],
KeyError: 'hr.payslip.line'

"payroll" is OCA/payroll module I've subscribed to fast log on hr.payslip model and that error shows when you try to compute sheet on payslip which already have line_ids...

github-actions[bot] commented 1 week 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.