first push message
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import multi_user_creation_wizard
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
from odoo import api, fields, models, _
|
||||
|
||||
|
||||
class MultiUserCreationWizard(models.TransientModel):
|
||||
_name = 'multi.user'
|
||||
_description = 'Multi User Creation Wizard'
|
||||
|
||||
user_data = fields.Text(string='User Data', required=True, help="Enter user data in the format: name,email,password")
|
||||
|
||||
@api.model
|
||||
def create_users(self, user_data):
|
||||
user_model = self.env['res.users']
|
||||
for line in user_data.split('\n'):
|
||||
name, email, password = line.split(',')
|
||||
user_model.create({
|
||||
'name': name,
|
||||
'login': email,
|
||||
'email': email,
|
||||
'password': password,
|
||||
})
|
||||
|
||||
def action_create_users(self):
|
||||
self.create_users(self.user_data)
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
Reference in New Issue
Block a user