Browse Source

[7.0] [FIX] Pep8

pull/71/head
Sylvain LE GAL 10 years ago
parent
commit
a389276869
  1. 2
      auth_admin_passkey/__openerp__.py
  2. 2
      base_optional_quick_create/model.py
  3. 2
      cron_run_manually/__openerp__.py
  4. 2
      email_template_template/model/email_template.py
  5. 2
      fetchmail_attach_from_folder/__openerp__.py
  6. 2
      fetchmail_attach_from_folder/match_algorithm/email_domain.py
  7. 2
      fetchmail_attach_from_folder/model/fetchmail_server.py
  8. 4
      fetchmail_attach_from_folder/wizard/attach_mail_manually.py
  9. 9
      import_odbc/import_odbc.py
  10. 6
      mass_editing/mass_editing.py
  11. 2
      scheduler_error_mailer/ir_cron.py
  12. 5
      server_environment/serv_config.py
  13. 2
      super_calendar/__openerp__.py
  14. 9
      super_calendar/super_calendar.py
  15. 2
      users_ldap_groups/users_ldap_groups.py
  16. 3
      users_ldap_groups/users_ldap_groups_operators.py
  17. 6
      users_ldap_mail/users_ldap_model.py
  18. 4
      users_ldap_populate/__openerp__.py
  19. 2
      users_ldap_populate/model/populate_wizard.py
  20. 2
      users_ldap_populate/model/users_ldap.py

2
auth_admin_passkey/__openerp__.py

@ -49,7 +49,7 @@ Copyright, Author and Licence :
'license': 'AGPL-3',
'depends': [
'mail',
],
],
'data': [
'data/ir_config_parameter.xml',
'view/res_config_view.xml',

2
base_optional_quick_create/model.py

@ -29,7 +29,7 @@ class ir_model(orm.Model):
_columns = {
'avoid_quick_create': fields.boolean('Avoid quick create'),
}
}
def _wrap_name_create(self, old_create, model):
def wrapper(cr, uid, name, context=None):

2
cron_run_manually/__openerp__.py

@ -34,4 +34,4 @@ of the scheduler.
'depends': ['base'],
'data': ['view/ir_cron.xml'],
'installable': True,
}
}

2
email_template_template/model/email_template.py

@ -40,7 +40,7 @@ class email_template(Model):
'is_template_template': fields.function(
_get_is_template_template, type='boolean',
string='Is a template template'),
}
}
def get_email_template(self, cr, uid, template_id=False, record_id=None,
context=None):

2
fetchmail_attach_from_folder/__openerp__.py

@ -38,7 +38,7 @@ client integration.
'view/fetchmail_server.xml',
'wizard/attach_mail_manually.xml',
'security/ir.model.access.csv',
],
],
'js': [],
'installable': True,
'active': False,

2
fetchmail_attach_from_folder/match_algorithm/email_domain.py

@ -40,6 +40,6 @@ class email_domain(email_exact):
self._get_mailaddress_search_domain(
conf, mail_message,
operator='like',
values=['%@'+domain for domain in set(domains)]),
values=['%@' + domain for domain in set(domains)]),
order=conf.model_order)
return ids

2
fetchmail_attach_from_folder/model/fetchmail_server.py

@ -182,7 +182,7 @@ class fetchmail_server(Model):
partner_id = self.pool.get(
folder.model_id.model).browse(
cr, uid, object_id, context
).partner_id.id
).partner_id.id
attachments = []
if this.attach and mail_message.get('attachments'):

4
fetchmail_attach_from_folder/wizard/attach_mail_manually.py

@ -74,8 +74,8 @@ class attach_mail_manually(TransientModel):
'msgid': msgid,
'subject': mail_message.get('subject', ''),
'date': mail_message.get('date', ''),
'object_id': folder.model_id.model+',False'
}))
'object_id': folder.model_id.model + ',False'
}))
connection.close()
return defaults

9
import_odbc/import_odbc.py

@ -67,8 +67,7 @@ class import_odbc_dbtable(orm.Model):
'last_log': fields.text('Last run log', readonly=True),
'ignore_rel_errors': fields.boolean(
'Ignore relationship errors',
help="On error try to reimport rows ignoring relationships."
),
help="On error try to reimport rows ignoring relationships."),
'raise_import_errors': fields.boolean(
'Raise import errors',
help="Import errors not handled, intended for debugging purposes."
@ -95,7 +94,7 @@ class import_odbc_dbtable(orm.Model):
+ ': '
+ obj_id.split('_')[-1])
if ': .' in msg and not rel_id:
rel_id = msg[msg.find(': .')+3:]
rel_id = msg[msg.find(': .') + 3:]
if '_id_' in rel_id:
rel_id = ('.'.join(rel_id.split('_')[:-2])
+ ': '
@ -251,7 +250,7 @@ class import_odbc_dbtable(orm.Model):
'function': 'import_run',
'doall': False,
'active': True
})
})
return {
'name': 'Import ODBC tables',
'view_type': 'form',
@ -259,4 +258,4 @@ class import_odbc_dbtable(orm.Model):
'res_model': 'ir.cron',
'res_id': new_create_id,
'type': 'ir.actions.act_window',
}
}

6
mass_editing/mass_editing.py

@ -103,7 +103,7 @@ class mass_object(orm.Model):
'view_mode': 'form,tree',
'target': 'new',
'auto_refresh': 1,
}, context)
}, context)
vals['ref_ir_value'] = ir_values_obj.create(cr, uid, {
'name': button_name,
'model': src_obj,
@ -112,11 +112,11 @@ class mass_object(orm.Model):
"ir.actions.act_window,"
+ str(vals['ref_ir_act_window'])),
'object': True,
}, context)
}, context)
self.write(cr, uid, ids, {
'ref_ir_act_window': vals.get('ref_ir_act_window', False),
'ref_ir_value': vals.get('ref_ir_value', False),
}, context)
}, context)
return True
def unlink_action(self, cr, uid, ids, context=None):

2
scheduler_error_mailer/ir_cron.py

@ -58,7 +58,7 @@ class ir_cron(orm.Model):
context = {
'job_exception': job_exception,
'dbname': cr.dbname,
}
}
logger.debug("Sending scheduler error email with context=%s",
context)

5
server_environment/serv_config.py

@ -172,8 +172,9 @@ class ServerConfiguration(orm.TransientModel):
arch += '</notebook></form>'
self._arch = etree.fromstring(arch)
def fields_view_get(self, cr, uid, view_id=None, view_type='form',
context=None, toolbar=False, submenu=False):
def fields_view_get(
self, cr, uid, view_id=None, view_type='form', context=None,
toolbar=False, submenu=False):
"""Overwrite the default method to render the custom view."""
res = super(ServerConfiguration, self).fields_view_get(cr, uid,
view_id,

2
super_calendar/__openerp__.py

@ -80,7 +80,7 @@ add it to a dashboard.
'super_calendar_view.xml',
'cron_data.xml',
'security/ir.model.access.csv',
],
],
'demo': [],
'test': [],
'installable': True,

9
super_calendar/super_calendar.py

@ -125,9 +125,9 @@ class super_calendar_configurator(orm.Model):
False
),
'configurator_id': configurator.id,
'res_id': line.name.model+','+str(record['id']),
'res_id': line.name.model + ',' + str(record['id']),
'model_id': line.name.id,
}
}
return super_calendar_values
@ -142,15 +142,14 @@ class super_calendar_configurator_line(orm.Model):
'description_type': fields.selection([
('field', 'Field'),
('code', 'Code'),
], string="Description Type"),
], string="Description Type"),
'description_field_id': fields.many2one(
'ir.model.fields', 'Description field',
domain="[('model_id', '=', name),('ttype', '=', 'char')]"),
'description_code': fields.text(
'Description field',
help="Use '${o}' to refer to the involved object. "
"E.g.: '${o.project_id.name}'"
),
"E.g.: '${o.project_id.name}'"),
'date_start_field_id': fields.many2one(
'ir.model.fields', 'Start date field',
domain="['&','|',('ttype', '=', 'datetime'),"

2
users_ldap_groups/users_ldap_groups.py

@ -59,7 +59,7 @@ class CompanyLDAPGroupMapping(orm.Model):
'group': fields.many2one(
'res.groups', 'OpenERP group',
help='The OpenERP group to assign', required=True),
}
}
class CompanyLDAP(orm.Model):

3
users_ldap_groups/users_ldap_groups_operators.py

@ -57,8 +57,7 @@ class query(LDAPOperator):
logger):
query_string = Template(value).safe_substitute(dict(
[(attr, ldap_entry[1][attribute][0]) for attr in ldap_entry[1]]
)
)
))
logger.debug('evaluating query group mapping, filter: %s',
query_string)
results = company.query(ldap_config, query_string)

6
users_ldap_mail/users_ldap_model.py

@ -35,11 +35,11 @@ class CompanyLDAP(orm.Model):
'mail_attribute': fields.char(
'E-mail attribute', size=64,
help="LDAP attribute to use to retrieve em-mail address."),
}
}
_defaults = {
'name_attribute': 'cn',
'mail_attribute': 'mail',
}
}
def get_ldap_dicts(self, cr, ids=None):
"""
@ -66,7 +66,7 @@ class CompanyLDAP(orm.Model):
mapping = [
('name', 'name_attribute'),
('email', 'mail_attribute'),
]
]
for value_key, conf_name in mapping:
try:
if conf[conf_name]:

4
users_ldap_populate/__openerp__.py

@ -40,11 +40,11 @@ object you want to query.
""",
"depends": [
'auth_ldap',
],
],
"data": [
'view/users_ldap.xml',
'view/populate_wizard.xml',
],
],
'installable': True,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

2
users_ldap_populate/model/populate_wizard.py

@ -31,7 +31,7 @@ class CompanyLDAPPopulateWizard(orm.TransientModel):
'res.company.ldap', 'LDAP Configuration'),
'users_created': fields.integer(
'Number of users created', readonly=True),
}
}
def create(self, cr, uid, vals, context=None):
ldap_pool = self.pool.get('res.company.ldap')

2
users_ldap_populate/model/users_ldap.py

@ -93,4 +93,4 @@ class CompanyLDAP(orm.Model):
'target': 'new',
'res_id': res_id,
'nodestroy': True,
}
}
Loading…
Cancel
Save