Skip to content

Odoo 17, rules on model product.template: Write operation with active=False (archiving) is not logged #3613

Description

@olenadziadyk

Root cause: When active field is set to False, the record becomes invisible to standard searches. If auditlog reads old/new values after the write, the record is already filtered out by Odoo's default active_test=True context, resulting in empty read and no log entry being created.
Fix: Use with_context(active_test=False) when reading values in the write hook:
pythonold_values = records.with_context(active_test=False).read(list(fields))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions