From 35df81d5414ce9dc5fb2c9204993d07c546554f1 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),