Browse Source

[FIX] Module 'auditlog' - Fix some flake8 errors

pull/1556/head
sebalix 10 years ago
parent
commit
31d5e6b548
  1. 1
      auditlog/models/log.py
  2. 16
      auditlog/models/rule.py

1
auditlog/models/log.py

@ -50,7 +50,6 @@ class auditlog_log_line(models.Model):
'ir.model.fields', string=u"Field", required=True) 'ir.model.fields', string=u"Field", required=True)
log_id = fields.Many2one( log_id = fields.Many2one(
'auditlog.log', string=u"Log", ondelete='cascade') 'auditlog.log', string=u"Log", ondelete='cascade')
#log = fields.Integer(u"Log ID")
old_value = fields.Text(u"Old Value") old_value = fields.Text(u"Old Value")
new_value = fields.Text(u"New Value") new_value = fields.Text(u"New Value")
old_value_text = fields.Text(u"Old value Text") old_value_text = fields.Text(u"Old value Text")

16
auditlog/models/rule.py

@ -206,20 +206,22 @@ class auditlog_rule(models.Model):
# FIXME: read() seems a bit tricky, improve to handle old/new api # FIXME: read() seems a bit tricky, improve to handle old/new api
# @api.v7 # @api.v7
#def read(self, cr, user, ids, fields=None, context=None, load='_classic_read', **kwargs):
# def read(self, cr, user, ids, fields=None, context=None,
# load='_classic_read', **kwargs):
# print "LOG READ", fields, load, kwargs # print "LOG READ", fields, load, kwargs
# # avoid loops # # avoid loops
# if self.env.context.get('auditlog_method_intercepted'): # if self.env.context.get('auditlog_method_intercepted'):
# return read.origin(self, cr, user, ids, fields, context, load, **kwargs)
# return read.origin(
# self, cr, user, ids, fields, context, load, **kwargs)
# # call original method with a modified context # # call original method with a modified context
# context = dict(self.env.context, auditlog_method_intercepted=True)
# context = dict(
# self.env.context, auditlog_method_intercepted=True)
# result = read.origin( # result = read.origin(
# self.with_context(context), # self.with_context(context),
# cr, user, ids, fields, context, load, **kwargs) # cr, user, ids, fields, context, load, **kwargs)
# print "RESULT", result # print "RESULT", result
# return result # return result
# @api.v8 # @api.v8
# def read(self, fields=None, load='_classic_read', **kwargs): # def read(self, fields=None, load='_classic_read', **kwargs):
# print "LOG READ", fields, load, kwargs # print "LOG READ", fields, load, kwargs
@ -227,7 +229,8 @@ class auditlog_rule(models.Model):
# if self.env.context.get('auditlog_method_intercepted'): # if self.env.context.get('auditlog_method_intercepted'):
# return read.origin(self, fields, load, **kwargs) # return read.origin(self, fields, load, **kwargs)
# # call original method with a modified context # # call original method with a modified context
# context = dict(self.env.context, auditlog_method_intercepted=True)
# context = dict(
# self.env.context, auditlog_method_intercepted=True)
# result = read.origin( # result = read.origin(
# self.with_context(context), fields, load, **kwargs) # self.with_context(context), fields, load, **kwargs)
# print "RESULT", result # print "RESULT", result
@ -385,7 +388,8 @@ class auditlog_rule(models.Model):
act_window.unlink() act_window.unlink()
if value: if value:
ir_value = ir_values_model.search( ir_value = ir_values_model.search(
[('model', '=', rule.model_id.model), ('value', '=', value)])
[('model', '=', rule.model_id.model),
('value', '=', value)])
if ir_value: if ir_value:
ir_value.unlink() ir_value.unlink()
self.write({'state': 'draft'}) self.write({'state': 'draft'})

Loading…
Cancel
Save