module: auditlog
version: 19.0
Steps to reproduce
- Install the auditlog module from OCA server-tools
- Configure an audit log rule for the hr.leave model
- Create a new time-off request (hr.leave) via the UI
Current behavior
An AssertionError is raised during record creation:
...
File "/home/odoo/src/user/addons/server-tools/auditlog/models/auditlog_rule.py", line 385, in create_full
new_record[fname], new_record
...
File "/home/odoo/src/odoo/odoo/orm/models.py", line 6425, in _flush
raise AssertionError(
AssertionError: Could not find all values of mail.activity(<id>,) to flush them
The error originates in auditlog_rule.py line 385 in create_full, where it tries to access new_record[fname] for relational fields (e.g. activity_ids) before the ORM cache is fully populated for related records created as side effects during hr.leave creation. The record is never saved and the user sees a generic server error.
Expected behavior
The audit log entry should be created successfully without interfering with the hr.leave creation. Accessing field values on the newly created record in create_full should either invalidate the cache first or handle the case where related records created as side effects are not yet fully cached, so the full ORM flush can complete without raising an AssertionError.
module: auditlog
version: 19.0
Steps to reproduce
Current behavior
An
AssertionErroris raised during record creation:The error originates in
auditlog_rule.pyline 385 increate_full, where it tries to accessnew_record[fname]for relational fields (e.g.activity_ids) before the ORM cache is fully populated for related records created as side effects duringhr.leavecreation. The record is never saved and the user sees a generic server error.Expected behavior
The audit log entry should be created successfully without interfering with the
hr.leavecreation. Accessing field values on the newly created record increate_fullshould either invalidate the cache first or handle the case where related records created as side effects are not yet fully cached, so the full ORM flush can complete without raising anAssertionError.