Reputation: 4174
I am trying to create a user by retrieving username, password and database_name
from a web page using a route /web/my_route
. It successfully create the user. But i need to add a field master_password
in web page and authenticate it to create user. I tried to find out master_password authentication functionality, but nothing find except below code
@http.route('/web/database/create', type='json', auth="none")
def create(self, fields):
params = dict(map(operator.itemgetter('name', 'value'), fields))
db_created = request.session.proxy("db").create_database(
params['super_admin_pwd'],
params['db_name'],
bool(params.get('demo_data')),
params['db_lang'],
params['create_admin_pwd'])
if db_created:
request.session.authenticate(params['db_name'], 'admin', params['create_admin_pwd'])
return db_created
But i couldn't find the function create_database
.
How can i do it? any suggestion ??
Upvotes: 0
Views: 333
Reputation: 2961
Create the field on the form, and on submit check it against odoo.tools.config['admin_passwd']
. This is the master admin password.
Upvotes: 1