From 175ba27144b0204164443e932d2c7931d045919b Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Wed, 16 Sep 2015 11:42:10 +0200 Subject: [PATCH] [FIX] if someone else has overridden our patched, method, don't do anything --- auditlog/models/rule.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/auditlog/models/rule.py b/auditlog/models/rule.py index 3b8862111..4f18c4a3e 100644 --- a/auditlog/models/rule.py +++ b/auditlog/models/rule.py @@ -170,7 +170,8 @@ class auditlog_rule(models.Model): for rule in self: model_model = self.env[rule.model_id.model] for method in ['create', 'read', 'write', 'unlink']: - if getattr(rule, 'log_%s' % method): + if getattr(rule, 'log_%s' % method) and hasattr( + getattr(model_model, method), 'origin'): model_model._revert_method(method) updated = True if updated: