From 5b4d117657ede72bea1e016e6ceb1aff7c38756f Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Thu, 29 Jan 2015 15:39:14 +0100 Subject: [PATCH] [ADD] pass old_values to create_log when deleting a record --- 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 bcc75b3ba..cec0e49b9 100644 --- a/auditlog/models/rule.py +++ b/auditlog/models/rule.py @@ -274,8 +274,10 @@ class auditlog_rule(models.Model): @api.multi def unlink(self, **kwargs): rule_model = self.env['auditlog.rule'] + old_values = dict( + (d['id'], d) for d in self.sudo().read(list(self._columns))) rule_model.sudo().create_logs( - self.env.uid, self._name, self.ids, 'unlink') + self.env.uid, self._name, self.ids, 'unlink', old_values) return unlink.origin(self, **kwargs) return unlink