This tutorial teaches how to create new users in ERP5. The difference between Person and User is that a Person in ERP5 holds information related to an individual which is relevant to your organisation (for example a prospect, client supplier or employee) while a User has access to your ERP5 instance. The permissions, a user has in ERP5 are defined by assignments.
During this tutorial, you will create two Users:
During this tutorial please replace "VIFIB" with your company name.
<tal:block metal:use-macro="here/Zuite_viewTestMacroLibrary/macros/init_test_environment" /> | ||
openAndWait | ${base_url}/Zuite_setUpPersonTest | |
verifyTextPresent | Init Ok | |
<tal:block metal:use-macro="here/Zuite_viewTestMacroLibrary/macros/wait_for_activities" /> | ||
<tal:block metal:use-macro="here/Zuite_viewTestMacroLibrary/macros/login_as_functional_test_user" /> | ||
<tal:block tal:define="click_configuration python: {'text': 'New'}"> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link" /> </tal:block> |
The process of creating a new User has three steps: Firstly, create and validate a Person who is the future User of your ERP5 instance. Secondly, add Assignment to this new User by using the Action item list. Finally, create User Account for this Person by using the Action item list. Then this new User can access to your ERP5 instance using the login and password you have set during the creation.
After reading the tutorial "How to create Persons", you can now try to create a new Person account for a staff of your company. In our case, we create an account for a VIFIB manager Cédric de Saint Martin, as shown in the screenshot. To be able to choose a password, it is critical to enter the Email address, because a link to choose the password will be sent by email.
waitForElementPresent | //button[text()="Person"] | |
click | //input[@name="editable"] | |
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"> </tal:block> | ||
click | //button[text()="Person"] |
Validate the Person you just created before going to next step.
waitForElementPresent | //input[@name="field_my_first_name"] | |
type | //input[@name="field_my_first_name"] | John |
type | //input[@name="field_my_last_name"] | Doh |
type | //input[@name="field_my_career_subordination_title"] | Z Company |
fireEvent | //input[@name="field_my_career_subordination_title"] | input |
waitForElementPresent | //ul[@class="search_ul"]//li | |
click | //ul[@class="search_ul"]/li[@name="Organisation"] | |
select | //select[@name="field_my_gender"] | Male |
select | //select[@name="subfield_field_my_career_role_list_default:list"] | Client |
select | //select[@name="field_my_career_function"] | Marketing/Marketing Manager |
select | //select[@name="field_my_career_activity"] | Education |
select | //select[@name="field_my_nationality"] | French |
type | //input[@name="field_my_default_email_coordinate_text"] | jdoh@zcompany.com |
type | //input[@name="field_default_telephone_my_default_telephone_coordinate_text"] | +33(0)6-218765/00 |
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save"> </tal:block> | ||
<tal:block tal:define="click_configuration python: {'text': 'Validate'}"> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link"> </tal:block> </tal:block> | ||
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"> </tal:block> | ||
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"> </tal:block> | ||
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"> </tal:block> |
Without the assignment, even you has added a user account to the person document, the person still won't be able to access your ERP5 instance. To check current Assignments of this person, click on "Assignment" on the sidebar; to start a new Assignment, click "+Add", choose "Assignment" in the Document Type List, then click "Create Document".
waitForElementPresent | //a[contains(text(), "Add")] | |
click | //a[contains(text(), "Add")] | |
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"> </tal:block> | ||
waitForElementPresent | //select[@name="field_your_select_action"] | |
select | //select[@name="field_your_select_action"] | Assignment |
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"> </tal:block> | ||
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"> </tal:block> |
Now you are located in the Assignment document. Fill in the fields and save the data.
Note: there two important fields to fill up. First, you must select the Group for the Assignment, and the Group must be your company, otherwise the User won't be able to access your ERP5 instance . Second, fill carefully the Assignment Start Date and Stop Date. The Assignment is only valid in the defined interval , which means the User can only login your ERP5 instance in the defined interval.
waitForElementPresent | //input[@name="field_my_title"] | |
type | //input[@name="field_my_title"] | SlapOS Community Manager |
type | //input[@name="field_my_start_date"] | 2021-01-14 |
type | //input[@name="field_my_stop_date"] | 2021-12-22 |
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/save"> </tal:block> |
After adding an Assignment to the new User, you have to start the Assignment, if not, the User account will not work. Click on "Start Assignment" on the sidebar.
<tal:block tal:define="click_configuration python: {'text': 'Start Assignment'}"> <tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link"> </tal:block> </tal:block> | ||
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/submit_dialog"> </tal:block> | ||
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"> </tal:block> | ||
waitForElementPresent | //p[@id="field_my_translated_validation_state_title"] | |
verifyText | //p[@id="field_my_translated_validation_state_title"] | Started |
After the status changed to "Started", you can continue next step: Create User.
To be able to log in the application, the user will need a login document, that can be either defined in ERP5 as an "ERP5 Login" document or externally, for example if using Google or Facebook, you would use "Google Login" or "Facebook Login" documents here.
Enter the login and save. The password will be defined later.
To be able to use this login, it needs to be validated. Click on "Start Assignment" on the sidebar.
From the login page, use "I forgot my password" and enter the user login. This will send an email to the email address registered on the person.
Click on the link received by email and choose the new password.
Try to log in your ERP5 instance with the new User Login and Password.
Note: It is important to remember the three steps must be performed correctly. Don't forget to Validate the login you created and to Start Assignment . Otherwise it won't be possible to connect to ERP5 using the user created.
Now that your learned how to create a user, please create a second user "Yingjie Xu". This user will be required to do the following tutorials. Make sure that you create the Person, the Assignment, start the Assignment and create the user account just like you did it for Cédric but using the information presented in this slide.
For more information, please contact Jean-Paul, CEO of Nexedi (+33 629 02 44 25).