Merge pull request #251 from hbrunn/8.0-auditlog_dont_crash_on_patched_method

[FIX] if someone else has overridden our patched,
pull/256/head
Guewen Baconnier 2015-09-17 08:06:14 +02:00
commit d58f0b16a0
1 changed files with 2 additions and 1 deletions

View File

@ -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: