Browse Source

Merge pull request #90 from hbrunn/8.0-travis-2014-12-08

[FIX] travis
pull/93/head
Pedro M. Baeza 10 years ago
parent
commit
08fd5c5781
  1. 57
      mass_editing/models/mass_object.py
  2. 2
      server_environment/serv_config.py
  3. 7
      users_ldap_mail/users_ldap_model.py
  4. 4
      users_ldap_populate/__openerp__.py
  5. 2
      users_ldap_populate/model/populate_wizard.py
  6. 2
      users_ldap_populate/model/users_ldap.py

57
mass_editing/models/mass_object.py

@ -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, {
'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 return True
def unlink_action(self, cr, uid, ids, context=None): def unlink_action(self, cr, uid, ids, context=None):

2
server_environment/serv_config.py

@ -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,

7
users_ldap_mail/users_ldap_model.py

@ -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]:

4
users_ldap_populate/__openerp__.py

@ -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,
} }

2
users_ldap_populate/model/populate_wizard.py

@ -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')

2
users_ldap_populate/model/users_ldap.py

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