Skip to Content
Menu
This question has been flagged

Hello there,

You know, when you disconnect a user from odoo, the auth_signup.template_user_id user is automatically logged.

I'm searching the exact place in the code where this auth_signup.template_user_id is logged. I would want to place a condition there to chose between different template users...

Where should I write my condition?

Thanks to help


UPDATE #1

Why it is impossible to get a log error from the file ./odoo-8.0-20150809/openerp/addons/auth_signup/res_config.py ???

No trace in the log when I connect. No trace when I start Odoo. No trace when I disconnect.

See my file content :


import logging

_logger = logging.getLogger(__name__)

from openerp.osv import osv, fields

from openerp.tools.safe_eval import safe_eval

class base_config_settings(osv.TransientModel):

_inherit = 'base.config.settings'

_columns = {

'auth_signup_reset_password': fields.boolean('Enable password reset from Login page',

help="This allows users to trigger a password reset from the Login page."),

'auth_signup_uninvited': fields.boolean('Allow external users to sign up',

help="If unchecked, only invited users may sign up."),

'auth_signup_template_user_id': fields.many2one('res.users',

string='Template user for new users created through signup'),

}

def get_default_auth_signup_template_user_id(self, cr, uid, fields, context=None):

icp = self.pool.get('ir.config_parameter')

# we use safe_eval on the result, since the value of the parameter is a nonempty string

_logger.error("get_default_auth_signup_template_user_id")

return {

'auth_signup_reset_password': safe_eval(icp.get_param(cr, uid, 'auth_signup.reset_password', 'False')),

'auth_signup_uninvited': safe_eval(icp.get_param(cr, uid, 'auth_signup.allow_uninvited', 'False')),

'auth_signup_template_user_id': safe_eval(icp.get_param(cr, uid, 'auth_signup.template_user_id', 'False')),

}

def set_auth_signup_template_user_id(self, cr, uid, ids, context=None):

config = self.browse(cr, uid, ids[0], context=context)

icp = self.pool.get('ir.config_parameter')

# we store the repr of the values, since the value of the parameter is a required string

_logger.error("set_auth_signup_template_user_id")

icp.set_param(cr, uid, 'auth_signup.reset_password', repr(config.auth_signup_reset_password))

icp.set_param(cr, uid, 'auth_signup.allow_uninvited', repr(config.auth_signup_uninvited))

icp.set_param(cr, uid, 'auth_signup.template_user_id', repr(config.auth_signup_template_user_id.id))

 


Avatar
Discard
Best Answer

A quick search with

grep -inR "auth_signup.template_user_id".

 drove me to

addons/auth_signup/res_config.py 
addons/auth_signup/auth_signup_data.xml

 I didn't find any other "call". Hope it helps.


 

Avatar
Discard
Related Posts Replies Views Activity
1
Sep 21
1434
8
Oct 24
20275
1
Mar 15
5856
1
Aug 21
2368
3
Oct 19
4777