[FIX] travis

pull/90/head
Holger Brunn 2014-12-08 09:47:25 +01:00
parent 15a8ff8fb0
commit c830d8fff3
6 changed files with 42 additions and 32 deletions

View File

@ -72,30 +72,39 @@ class MassObject(orm.Model):
for data in self.browse(cr, uid, ids, context=context): for data in self.browse(cr, uid, ids, context=context):
src_obj = data.model_id.model src_obj = data.model_id.model
button_name = _('Mass Editing (%s)') % data.name button_name = _('Mass Editing (%s)') % data.name
vals['ref_ir_act_window'] = action_obj.create(cr, SUPERUSER_ID, { vals['ref_ir_act_window'] = action_obj.create(
'name': button_name, cr, SUPERUSER_ID,
'type': 'ir.actions.act_window', {
'res_model': 'mass.editing.wizard', 'name': button_name,
'src_model': src_obj, 'type': 'ir.actions.act_window',
'view_type': 'form', 'res_model': 'mass.editing.wizard',
'context': "{'mass_editing_object' : %d}" % (data.id), 'src_model': src_obj,
'view_mode': 'form,tree', 'view_type': 'form',
'target': 'new', 'context': "{'mass_editing_object' : %d}" % (data.id),
'auto_refresh': 1, 'view_mode': 'form,tree',
}, context) 'target': 'new',
vals['ref_ir_value'] = ir_values_obj.create(cr, SUPERUSER_ID, { 'auto_refresh': 1,
'name': button_name, },
'model': src_obj, context)
'key2': 'client_action_multi', vals['ref_ir_value'] = ir_values_obj.create(
'value': ( cr, SUPERUSER_ID,
"ir.actions.act_window," {
+ str(vals['ref_ir_act_window'])), 'name': button_name,
'object': True, 'model': src_obj,
}, context) 'key2': 'client_action_multi',
self.write(cr, uid, ids, { 'value': (
'ref_ir_act_window': vals.get('ref_ir_act_window', False), "ir.actions.act_window,"
'ref_ir_value': vals.get('ref_ir_value', False), + str(vals['ref_ir_act_window'])),
}, context) '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 return True
def unlink_action(self, cr, uid, ids, context=None): def unlink_action(self, cr, uid, ids, context=None):

View File

@ -215,7 +215,7 @@ class ServerConfiguration(models.TransientModel):
self._arch = etree.fromstring(arch) self._arch = etree.fromstring(arch)
def fields_view_get(self, cr, uid, view_id=None, view_type='form', 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.""" """Overwrite the default method to render the custom view."""
res = super(ServerConfiguration, self).fields_view_get(cr, uid, res = super(ServerConfiguration, self).fields_view_get(cr, uid,
view_id, view_id,

View File

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

View File

@ -39,10 +39,10 @@ object you want to query.
""", """,
"depends": [ "depends": [
'auth_ldap', 'auth_ldap',
], ],
"data": [ "data": [
'view/users_ldap.xml', 'view/users_ldap.xml',
'view/populate_wizard.xml', 'view/populate_wizard.xml',
], ],
'installable': True, 'installable': True,
} }

View File

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

View File

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