2012-06-25 12:26:30 +00:00
|
|
|
from openerp.osv import osv, fields
|
|
|
|
|
2012-07-25 19:55:40 +00:00
|
|
|
class base_config_settings(osv.TransientModel):
|
2012-06-25 12:26:30 +00:00
|
|
|
_inherit = 'base.config.settings'
|
|
|
|
|
|
|
|
_columns = {
|
2012-07-25 23:02:17 +00:00
|
|
|
'auth_signup_template_user_id': fields.many2one('res.users', 'Template user for signup')
|
2012-06-25 12:26:30 +00:00
|
|
|
}
|
|
|
|
|
2012-07-25 19:55:40 +00:00
|
|
|
def get_default_signup(self, cr, uid, fields, context=None):
|
2012-06-25 12:26:30 +00:00
|
|
|
icp = self.pool.get('ir.config_parameter')
|
|
|
|
return {
|
2012-07-25 23:02:17 +00:00
|
|
|
'auth_signup_template_user_id': icp.get_param(cr, uid, 'auth.signup_template_user_id', 0) or False
|
2012-06-25 12:26:30 +00:00
|
|
|
}
|
|
|
|
|
2012-07-25 19:55:40 +00:00
|
|
|
def set_signup(self, cr, uid, ids, context=None):
|
2012-06-25 12:26:30 +00:00
|
|
|
config = self.browse(cr, uid, ids[0], context=context)
|
|
|
|
icp = self.pool.get('ir.config_parameter')
|
2012-07-25 23:02:17 +00:00
|
|
|
icp.set_param(cr, uid, 'auth.signup_template_user_id', config.signup_user_template_id.id)
|
2012-07-25 19:55:40 +00:00
|
|
|
|