From 0f35f705dab1629a606af0fe3434f6f4474137f8 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Thu, 29 Jan 2015 13:04:49 +0100 Subject: [PATCH] [ADD] allow overriding modules to pass additional log values --- auditlog/models/rule.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/auditlog/models/rule.py b/auditlog/models/rule.py index ecab76811..4c897ecfe 100644 --- a/auditlog/models/rule.py +++ b/auditlog/models/rule.py @@ -274,7 +274,8 @@ class auditlog_rule(models.Model): return unlink def create_logs(self, uid, res_model, res_ids, method, - old_values=None, new_values=None): + old_values=None, new_values=None, + additional_log_values=None): """Create logs. `old_values` and `new_values` are dictionnaries, e.g: {RES_ID: {'FIELD': VALUE, ...}} """ @@ -295,6 +296,7 @@ class auditlog_rule(models.Model): 'method': method, 'user_id': uid, } + vals.update(additional_log_values) log = log_model.create(vals) diff = DictDiffer( new_values.get(res_id, EMPTY_DICT),