From c830d8fff3284ec8ec073e690edebceff4b090e6 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 8 Dec 2014 09:47:25 +0100 Subject: [PATCH] [FIX] travis --- mass_editing/models/mass_object.py | 57 +++++++++++--------- server_environment/serv_config.py | 2 +- users_ldap_mail/users_ldap_model.py | 7 +-- users_ldap_populate/__openerp__.py | 4 +- users_ldap_populate/model/populate_wizard.py | 2 +- users_ldap_populate/model/users_ldap.py | 2 +- 6 files changed, 42 insertions(+), 32 deletions(-) diff --git a/mass_editing/models/mass_object.py b/mass_editing/models/mass_object.py index 6e436e8be..0df2937c3 100644 --- a/mass_editing/models/mass_object.py +++ b/mass_editing/models/mass_object.py @@ -72,30 +72,39 @@ class MassObject(orm.Model): for data in self.browse(cr, uid, ids, context=context): src_obj = data.model_id.model button_name = _('Mass Editing (%s)') % data.name - vals['ref_ir_act_window'] = action_obj.create(cr, SUPERUSER_ID, { - 'name': button_name, - 'type': 'ir.actions.act_window', - 'res_model': 'mass.editing.wizard', - 'src_model': src_obj, - 'view_type': 'form', - 'context': "{'mass_editing_object' : %d}" % (data.id), - 'view_mode': 'form,tree', - 'target': 'new', - 'auto_refresh': 1, - }, context) - vals['ref_ir_value'] = ir_values_obj.create(cr, SUPERUSER_ID, { - 'name': button_name, - 'model': src_obj, - 'key2': 'client_action_multi', - 'value': ( - "ir.actions.act_window," - + str(vals['ref_ir_act_window'])), - 'object': True, - }, 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) + vals['ref_ir_act_window'] = action_obj.create( + cr, SUPERUSER_ID, + { + 'name': button_name, + 'type': 'ir.actions.act_window', + 'res_model': 'mass.editing.wizard', + 'src_model': src_obj, + 'view_type': 'form', + 'context': "{'mass_editing_object' : %d}" % (data.id), + 'view_mode': 'form,tree', + 'target': 'new', + 'auto_refresh': 1, + }, + context) + vals['ref_ir_value'] = ir_values_obj.create( + cr, SUPERUSER_ID, + { + 'name': button_name, + 'model': src_obj, + 'key2': 'client_action_multi', + 'value': ( + "ir.actions.act_window," + + str(vals['ref_ir_act_window'])), + 'object': True, + }, + 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) return True def unlink_action(self, cr, uid, ids, context=None): diff --git a/server_environment/serv_config.py b/server_environment/serv_config.py index 55960e3c4..1645e700c 100644 --- a/server_environment/serv_config.py +++ b/server_environment/serv_config.py @@ -215,7 +215,7 @@ class ServerConfiguration(models.TransientModel): self._arch = etree.fromstring(arch) def fields_view_get(self, cr, uid, view_id=None, view_type='form', - context=None, toolbar=False, submenu=False): + 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, diff --git a/users_ldap_mail/users_ldap_model.py b/users_ldap_mail/users_ldap_model.py index 7640672c4..731e7c6bb 100644 --- a/users_ldap_mail/users_ldap_model.py +++ b/users_ldap_mail/users_ldap_model.py @@ -35,11 +35,12 @@ 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): """ @@ -65,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]: diff --git a/users_ldap_populate/__openerp__.py b/users_ldap_populate/__openerp__.py index 07bd03048..79f36fb28 100644 --- a/users_ldap_populate/__openerp__.py +++ b/users_ldap_populate/__openerp__.py @@ -39,10 +39,10 @@ object you want to query. """, "depends": [ 'auth_ldap', - ], + ], "data": [ 'view/users_ldap.xml', 'view/populate_wizard.xml', - ], + ], 'installable': True, } diff --git a/users_ldap_populate/model/populate_wizard.py b/users_ldap_populate/model/populate_wizard.py index 24a7dd264..039244462 100644 --- a/users_ldap_populate/model/populate_wizard.py +++ b/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') diff --git a/users_ldap_populate/model/users_ldap.py b/users_ldap_populate/model/users_ldap.py index 1bed8a83a..7d02166a1 100644 --- a/users_ldap_populate/model/users_ldap.py +++ b/users_ldap_populate/model/users_ldap.py @@ -93,4 +93,4 @@ class CompanyLDAP(orm.Model): 'target': 'new', 'res_id': res_id, 'nodestroy': True, - } + }