Browse Source

[ADD] pass old_values to create_log when deleting a record

pull/1556/head
Holger Brunn 10 years ago
committed by sebalix
parent
commit
fe11e254ea
  1. 4
      auditlog/models/rule.py

4
auditlog/models/rule.py

@ -274,8 +274,10 @@ class auditlog_rule(models.Model):
@api.multi @api.multi
def unlink(self, **kwargs): def unlink(self, **kwargs):
rule_model = self.env['auditlog.rule'] 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( 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.origin(self, **kwargs)
return unlink return unlink

Loading…
Cancel
Save