How to Link People to Organisations
The photo of John Scott Doh and Z Commpany by OSOE Team.
This visual guide is part of a collection of documents created by the One
Student One ERP (OSOE) project in collaboration with Institut Mines Telecom,
Telecom Bretagne, Dresden University of Technology and the South Westfalia
University of Applied Sciences. It can be used to teach modern ERP theory and
practice to undergraduate students or professionals.
Copyright: You are free to copy, distribute, display, and perform the work
under the following conditions: you must attribute the work in the manner
specified by the author or licensor; you may not use this work for any
commercial purposes including training, consulting, advertising,
self-advertising, publishing, etc.; you may not alter, transform, or build upon
this work. For any reuse or distribution, you must make clear to others the
license terms of this work. Any of these conditions can be waived if you get
permission from the copyright holder through a commercial license or an
educational license. For more information, contact info@nexedi.com
init
openAndWait ${base_url}/Zuite_setUpPersonAndOrganisationLinkingTest
verifyTextPresent Init Ok
Wait for activities
Login As Functional Test User
Agenda
• How to link a person to an existing organisation
• How to link a person to a new organisation
In this tutorial you will learn how to link people and organisations. You might
have noticed in the previous tutorials that persons and organisations are very
important in ERP5, because they are the core of your business.
We have already showed you how to link people to his/her organisation through
the person creation process, but now we will examine some of the details in
depth to show you how you can link a person to an existing organisation or to a
new organisation. As we have used VIFIB example to created a person and an
organisation in the previous two tutorials, now we will continue using those
two entities to explain how to link them together.
Example
Link people to organisations example: John Scott Doh and Z Company
As we have created a person and an organisation in the first two tutorials, we
are now going to use those two entities to explain how to link them together.
Linking to an existing organisation
Link people to exisiting organization in ERP5: Z Company
Already created in ERP5: YES
The easiest way to link a person to an organisation, is to create the
organisation first. Once the organisation is created, you can link people to it
by browsing the person's details and set the relationship with the existing
organisation. As described in the previous tutorial, Z Company has already been
created in ERP5, (see Tutorial "How to create Organisations"), we'll follow the
organisation creation process to explain how to link a person to an existing
organisation in ERP5.
Go to the person's page (1) From ERP5 home menu
Browse the 'Persons' database to reach the person's page
First, you need to go to the page of the person you want to link to the
existing organisation. You can reach this page by clicking on “Persons” in the
“Modules”page.
Click on “Modules” on the sidebar => Click on the “Persons”
Go to the person's page (2)
Click on person's line to reach person's page
Click on the line representing the person who's details you want to browse.
In our case, simply click on the line “John Doh”. Then you will reach the page
of John Doh. If you don't see that line, please search for the person by typing
"%John Doh%" in the searching tab (You can use Fuzzy Enquiry method in ERP5
base data list page to search for any information you need). After you press
the enter button on the keyboard, the line of John Doh will appear if you have
created the person correctly according to the previous tutorial "How to create
Persons".
click //a[text()="ZUITE-TEST-LINK USER-001"]
click //input[@name="editable"]
waitForElementPresent //input[@name="field_my_first_name"]
assertValue //input[@name="field_my_last_name"] USER-001
storeLocation person
Wait for activities
Click on the "magnify glass"
Set relation: Click on the 'wheel'
Now you should have landed on John Doh's View page, from which we are going to
set a relation between him and his company which has been created, Z Company,
as described in the introduction of this tutorial.
Just next to the “organisation” field, you can see a magnify glass. This is the
tool in ERP5 which allows you to set relations between different items. Here
you use the magnify glass to link a person to an organisation that has been
previously created in ERP5. So just click on this magnify glass, then it will
open a list of all existing organisations. In our example, we want to link John
Doh to Z Company, we have opened the page of John Doh, now after we click on
the magnifying glass, we can see different existing organisations (as shown in
the following screenshot), and then choose Z Company that John Doh should be
linked to.
open ${person}
click //div[@class="relation-input ui-input-text"]/button
Choose the organisation and set the relation(1)
Set relation: choose the existing organisation 1
Choose the organisation and set the relation(2)
Set relation: choose the existing organisation 2
Here are some points you need to pay attention to in this step
(1)Choose the appropriate organisation and Set relation:
Once the list of organisations is open, select the organisation you want to
link the person with by clicking on the "arrow" in the last column of the
organisation.
In our example, we want to link John Doh to Z Company, so we click the
"arrow" of Z Company, as you can see on the screenshot.
(2)Check the "plane" icon:
After you have set the relation, the "magnify glass" icon will change to a
"plane" icon (as you can see in the following screenshot), which means that you
have set a relation between two items in ERP5, and this "plane" icon can lead
you to the related subject. In our example, once the "magnify glass" turns into
the "plane", John Doh is related to Z Company, and then you can check the
relation by clicking on the "plane" to go to the page of Z Company.
assertElementPresent //a[text()="ZUITE-TEST-LINK-ORGANISATION-001"]
click //a[text()="ZUITE-TEST-LINK-ORGANISATION-001"]
Check the relation (1)
Check relation: Click on the 'plane'
1. Go to the organisation's page.
Now that the relation is set, we will check that the operation worked
correctly. To do this, go to the appropriate organisation's page, and make sure
that the person is related to it.
To go to the organisation's page, you can either use one of the methods you
learned in the previous tutorials (eg, browse the base data in the ERP5 home
page, or use this new method - the "plane"
In our example, now that we have set the relation between John Doh and Z
Company, in John Doh's page, we can click on the “plane” icon next to his
organisation Z Company, which opens the View page of Z Company.
assertValue //input[@name= ZUITE-TEST-LINK-ORGANISATION-001
"field_my_career_subordination_title"]
click //div[@class="relation-input
ui-input-text"]/a
assertValue //input[@name="field_my_title"] ZUITE-TEST-LINK-ORGANISATION-001
Check the relation (2)
Check relation: Check the person's line
2. Check on the linked person's information line.
Check on the bottom of the organisation's page you have just reached and then
click on the line of the appropriate person who has been linked to it. In our
example, on the bottom of the page of Z Company, we can see the line “John
Doh”with his basic information. This line confirms that John Doh has been
linked to his company Z Company, as a Marketing Manager.
storeLocation organisation
Wait for activities
open ${organisation}
click //a[text()="ZUITE-TEST-LINK"]
waitForElementPresent //input[@name="field_my_first_name"]
assertValue //input[@name="field_my_first_name"] ZUITE-TEST-LINK
Linking to a new organisation
Link people to new organization Y Company
Already created in ERP5: No
ERP5 allows you to create a new organisation directly from a person's View
page, in this way you can link a person to the organisation directly.
Now let's see a new example: Lei XU is working for the Y Company. First, create
the person, just like you learned to create a new person in the tutorial "How
to create Persons". Now let's see how can we link him directly to the new
company.
Go to the person's page
Set relation: go to person's page
First you need to go the View page of the person you want to link to the
organisation.
Type the organisation's name
Set relation: type new organisation's name and save
Once have created the person Lei XU, just type the name of his/her organisation
in the “organisation” field. When you are ready, click the save button.
Add organisation
Set relation: add new organisation
ERP5 will alert you that the organisation that you try to link your person to
does not exist, but offers you to create it. If you accept, the related
organisation will be created, and the person will be directly linked to it.
To do this, first browse the item menu circled in red, then click on “Create
New Organisation: Y Company”. This will create the organisation and save the
operation automatically.
You can now check that everything worked fine by going to the related
organisation's page. To do this, you can use one of the methods you learned in
the first tutorials, or simply click on the "plane" icon next to the
"organisation” field. This will lead you to the related organisation's page (as
described in the first part of this tutorial).
Login As Manager
openAndWait ${base_url}/Zuite_tearDownPersonAndOrganisationLinkingTest
verifyTextPresent Clean Ok
Wait for activities