Commit Graph

56 Commits (75c20bb7de357606ccb4dbf0177f009333f7430b)

Author SHA1 Message Date
SilvioC2C 75c20bb7de FIX: auditlog consistency with Many2one fields
Odoo allows creating or updating records with values like ``{"many2one_field_id": empty.recordset()}``,
but this crashes when using ``deepcopy``, which fails in recreating the ``api.Environment`` object
attached to the recordset.
This commit should fix the issue by updating the values before passing them to ``deepcopy``.
2023-09-11 12:49:02 +02:00
Stefan Rijnhart c8671aa35b [MIG] auditlog: Migration to 16.0 2022-11-18 13:54:56 +01:00
Atchuthan Ubendran 470d8def8a Add option to Eliminate user and fields in audit logs 2022-11-18 13:12:58 +01:00
BT-vgabor 6dfa4ae522 [MIG] auditlog: Migration to 15.0 2022-11-18 13:12:58 +01:00
Bhavesh Odedra bf727fc6a5 [ADD] auditlog: test case for capture record 2022-11-18 13:12:58 +01:00
Bhavesh Odedra 2ab065271d [ADD] auditlog: enable to track Unlink record 2022-11-18 13:12:57 +01:00
Pieter Paulussen 3b73d50906 [IMP] auditlog: prevent cascading delete of logs when models or fields are unlinked
When a field or a model is unlinked, keep the related audit logs. Denormalize
the field and model info on the logs and log lines so that the information
is still available after the deletion of the related data model.

Also, to improve the performance of the deletion of fields and models,
add indexes on the log's model_id and log line's field_id.

Co-Authored-By: Stefan Rijnhart <stefan@opener.am>
2022-11-18 13:12:57 +01:00
tslai a92184c6a4 [14.0][FIX] Add sudo() to retrieve record vals 2022-11-18 13:12:57 +01:00
Tom Blauwendraat 14ee0edbf9 [IMP] Dont query non-stored related or computed fields on full auditlog, this can slow down the system a lot and gives no useful info 2022-11-18 13:12:57 +01:00
Jesús Alan Ramos Rodríguez 9e52d843cb [MIG] auditlog: Migration to 14.0 2022-11-18 13:12:57 +01:00
Jesús Alan Ramos Rodríguez 786683cfff [IMP] auditlog: black, isort, prettier 2022-11-18 13:12:57 +01:00
sebalix 2fe2d13b21 [FIX] auditlog: add support for create multi 2022-11-18 13:12:57 +01:00
sebalix 709d61f60e [FIX] auditlog: log computed fields stored in db as expected
Fixing #1134.
Odoo stores values of computed fields at the end of the transaction
only, as such performing a 'read()' to make a data snapshot on the record
created in the current transaction doesn't return the expected result
regarding these fields.
Also as a side-effect 'read()' alters the environment cache and break the
values on the record inducing issues in the whole user
transaction/workflow.

This fix replaces the use of 'read()' to do the data snapshot directly
from the cache of the record (computed values are already there).
2022-11-18 13:12:57 +01:00
Raf Ven 732654f95f [IMP] auditlog: black, isort, prettier 2022-11-18 13:12:57 +01:00
Eric Lembregts 1b1f827c1b [MIG] auditlog: Migration to 13.0 2022-11-18 13:12:57 +01:00
sebalix 3487299909 [MIG] auditlog: Migration to 12.0 2022-11-18 13:12:57 +01:00
rgarnau 3959096570 [add] https 2022-11-18 13:12:57 +01:00
Enric Tobella e3d6d8bbd2 [MIG] auditlog: Migration to 11.0 2022-11-18 13:12:57 +01:00
Oleg Bulkin 24c858f2c0 [FIX] auditlog: Duplicate logging
* Update _patch_methods and _revert_methods in auditlog.rule model to properly
track whether a method has already been patched for logging purposes. This
prevents duplicate logs from being produced in various cases (e.g. when a
logging rule is created as part of a module install)
2022-11-18 13:12:57 +01:00
Frédéric Garbely 4e1e1eacff [MIG] auditlog: Migrated to 10.0 2022-11-18 13:12:57 +01:00
sebalix f84fe98c15 auditlog - Migrate 'AuditlogRule.create' and 'AuditlogRule.write' methods to the new API 2022-11-18 13:12:57 +01:00
Holden Rehg de52936630 Migrate auditlog module from 8.0 to 9.0
- Update documentation to point to the new auditlog menu locations. These were changed because the 8.0 version was referencing menus that do not exist in 9.0
- Change version from 8.0.X.Y.Z to 9.0.1.0.0
- Make the module installable again
- Remove an unused parameter from pre-migration.py for versioning
- Fix typos and remove commented out blocks of code that were irrelevant
2022-11-18 13:12:57 +01:00
Sébastien Alix 557d2dfb03 auditlog - Icon added + README updated (screenshots) 2022-11-18 13:12:57 +01:00
sebalix ebd69dbb72 auditlog - Field 'type' renamed to 'log_type' 2022-11-18 13:12:57 +01:00
sebalix 9808fa08c7 auditlog - Ability to choose the log type on the rule: Full log (complete but slow) and Fast log (data input only, faster) 2022-11-18 13:12:57 +01:00
Holger Brunn f755beae2d turn off prefetching when reding values 2022-11-18 13:12:57 +01:00
sebalix 7bd19662d3 Module 'auditlog' - Fix pylint check 2022-11-18 13:12:57 +01:00
sebalix 4c11ec5b2e Module 'auditlog' - Log HTTP user sessions and requests 2022-11-18 13:12:57 +01:00
Holger Brunn 703ecc7e71 [FIX] if someone else has overridden our patched,
method, don't do anything
2022-11-18 13:12:57 +01:00
Holger Brunn 27494e4d6a [FIX] make patched create downgrade correctly to v6.1 2022-11-18 13:12:57 +01:00
Holger Brunn b61206ccbb [ADD] comment 2022-11-18 13:12:57 +01:00
Holger Brunn 0f0540ff92 [FIX] ie related fields don't have an
ir.model.fields entry
2022-11-18 13:12:57 +01:00
sebalix b82aa2330c [FIX] Module 'auditlog' - Log fields coming from polymorphic inheritances ('_inherits') 2022-11-18 13:12:57 +01:00
sebalix cc25ff8387 [IMP] Module 'auditlog' - Unsubscribe rules before removing them + Unit tests updated 2022-11-18 13:12:57 +01:00
sebalix 85e305e2c9 [FIX] Module 'auditlog' - Fix lint check 2022-11-18 13:12:57 +01:00
sebalix 1fad8d100e [FIX] Module 'auditlog' - No log for internal processing (e.g. 'read' calls produced by auditlog, either to scan records data or to fetch informations from 'ir.model'/'ir.model.fields' data models if rules are defined on them) 2022-11-18 13:12:57 +01:00
sebalix 0fddc605f6 [FIX] Module 'auditlog' - Support 'read' calls with one ID or a list of IDs 2022-11-18 13:12:57 +01:00
sebalix b0c5e2e2cf [FIX] Module 'auditlog' - Replace 'try/except statement by 'isinstance()' + Add missing field in unit test + Remove a list comprehension 2022-11-18 13:12:57 +01:00
sebalix 1010b0ac1c [IMP] Module 'auditlog' - Performing logs on 'read' operations + Some bugfixes to log inherited fields and dummy fields such as 'in_group_X' in 'res.users' model + Unit tests updated 2022-11-18 13:12:57 +01:00
sebalix 0ac895c988 [FIX] Module 'auditlog' - When updating a resource, filter IDs on 2many fields to prevent a 'name_get()' call on potential deleted resources 2022-11-18 13:12:57 +01:00
sebalix 6b92a949e8 [FIX] Module 'auditlog' - Data dictionaries of fields and models are put in the cache instead of recordsets (a recordset contains a reference on the database cursor which is closed after each RPC query) 2022-11-18 13:12:57 +01:00
sebalix c77e26f78d [IMP] Module 'auditlog' - Model 'auditlog.log.line', 'field_name' and 'field_description' fields changed into related fields 2022-11-18 13:12:57 +01:00
sebalix a6d98814f5 [IMP] Module 'auditlog' - Useless lines of code removed 2022-11-18 13:12:57 +01:00
sebalix 436c151f9a [FIX] Module 'auditlog' - local variable 'ir_model' is assigned to but never used 2022-11-18 13:12:57 +01:00
Holger Brunn f1073f7ed1 [FIX] cope with no additional log values 2022-11-18 13:12:57 +01:00
Holger Brunn 9e8cd4aa36 [ADD] pass old_values to create_log when deleting a record 2022-11-18 13:12:57 +01:00
Holger Brunn 072533bb95 [FIX] don't reset caches in register_hook 2022-11-18 13:12:57 +01:00
Holger Brunn 3562d9f94e [IMP] don't make a temporary copy of dict keys 2022-11-18 13:12:57 +01:00
Holger Brunn 34111cf235 [IMP] cache model and field ids 2022-11-18 13:12:57 +01:00
Holger Brunn d57115fd40 [ADD] allow overriding modules to pass additional log values 2022-11-18 13:12:57 +01:00