Browse Source

Module 'auditlog' - Fix pylint check

pull/1556/head
sebalix 9 years ago
parent
commit
f78399a352
  1. 1
      auditlog/__manifest__.py
  2. 4
      auditlog/models/log.py
  3. 10
      auditlog/models/rule.py

1
auditlog/__manifest__.py

@ -23,6 +23,7 @@
'name': "Audit Log", 'name': "Audit Log",
'version': "8.0.1.1.0", 'version': "8.0.1.1.0",
'author': "ABF OSIELL,Odoo Community Association (OCA)", 'author': "ABF OSIELL,Odoo Community Association (OCA)",
'license': "AGPL-3",
'website': "http://www.osiell.com", 'website': "http://www.osiell.com",
'category': "Tools", 'category': "Tools",
'depends': [ 'depends': [

4
auditlog/models/log.py

@ -22,7 +22,7 @@
from openerp import models, fields from openerp import models, fields
class auditlog_log(models.Model):
class AuditlogLog(models.Model):
_name = 'auditlog.log' _name = 'auditlog.log'
_description = "Auditlog - Log" _description = "Auditlog - Log"
_order = "create_date desc" _order = "create_date desc"
@ -42,7 +42,7 @@ class auditlog_log(models.Model):
'auditlog.http.request', string=u"HTTP Request") 'auditlog.http.request', string=u"HTTP Request")
class auditlog_log_line(models.Model):
class AuditlogLogLine(models.Model):
_name = 'auditlog.log.line' _name = 'auditlog.log.line'
_description = "Auditlog - Log details (fields updated)" _description = "Auditlog - Log details (fields updated)"

10
auditlog/models/rule.py

@ -58,7 +58,7 @@ class DictDiffer(object):
if self.past_dict[o] == self.current_dict[o]) if self.past_dict[o] == self.current_dict[o])
class auditlog_rule(models.Model):
class AuditlogRule(models.Model):
_name = 'auditlog.rule' _name = 'auditlog.rule'
_description = "Auditlog - Rule" _description = "Auditlog - Rule"
@ -110,7 +110,7 @@ class auditlog_rule(models.Model):
def _register_hook(self, cr, ids=None): def _register_hook(self, cr, ids=None):
"""Get all rules and apply them to log method calls.""" """Get all rules and apply them to log method calls."""
super(auditlog_rule, self)._register_hook(cr)
super(AuditlogRule, self)._register_hook(cr)
if not hasattr(self.pool, '_auditlog_field_cache'): if not hasattr(self.pool, '_auditlog_field_cache'):
self.pool._auditlog_field_cache = {} self.pool._auditlog_field_cache = {}
if not hasattr(self.pool, '_auditlog_model_cache'): if not hasattr(self.pool, '_auditlog_model_cache'):
@ -182,7 +182,7 @@ class auditlog_rule(models.Model):
# errors occurs with the `_register_hook()` BaseModel method. # errors occurs with the `_register_hook()` BaseModel method.
def create(self, cr, uid, vals, context=None): def create(self, cr, uid, vals, context=None):
"""Update the registry when a new rule is created.""" """Update the registry when a new rule is created."""
res_id = super(auditlog_rule, self).create(
res_id = super(AuditlogRule, self).create(
cr, uid, vals, context=context) cr, uid, vals, context=context)
if self._register_hook(cr, [res_id]): if self._register_hook(cr, [res_id]):
modules.registry.RegistryManager.signal_registry_change(cr.dbname) modules.registry.RegistryManager.signal_registry_change(cr.dbname)
@ -194,7 +194,7 @@ class auditlog_rule(models.Model):
"""Update the registry when existing rules are updated.""" """Update the registry when existing rules are updated."""
if isinstance(ids, (int, long)): if isinstance(ids, (int, long)):
ids = [ids] ids = [ids]
super(auditlog_rule, self).write(cr, uid, ids, vals, context=context)
super(AuditlogRule, self).write(cr, uid, ids, vals, context=context)
if self._register_hook(cr, ids): if self._register_hook(cr, ids):
modules.registry.RegistryManager.signal_registry_change(cr.dbname) modules.registry.RegistryManager.signal_registry_change(cr.dbname)
return True return True
@ -203,7 +203,7 @@ class auditlog_rule(models.Model):
def unlink(self): def unlink(self):
"""Unsubscribe rules before removing them.""" """Unsubscribe rules before removing them."""
self.unsubscribe() self.unsubscribe()
return super(auditlog_rule, self).unlink()
return super(AuditlogRule, self).unlink()
def _make_create(self): def _make_create(self):
"""Instanciate a create method that log its calls.""" """Instanciate a create method that log its calls."""

Loading…
Cancel
Save