TP1: Starting OpenERP 7.0 server and first administration steps
Rule 1: At the end of the class session, you will send your answer in a PDF file.
Rule 2: Don't read too fast, take your time to read all the instructions carefully.
Rule 3: Before leaving your computer, you will save your database as explained in exercise 2.6. Then, you will drop your database from OpenERP in order to leave everything clean for the next person who will use this computer.
Exercice 1 • Server side: Install and configure environment for OpenERP 7.0
The aim is to prepare the environment to run OpenERP.
FIRST, before doing anything, you have to make a copy of the virtual machine (OpenERP_32bits), from V:\VM\masters\vmware\ to a directory of your name on V:\VM\work\
If needed, more information about Virtuals Machines is available at http://it-portal.groupe-efrei.fr/ress/vm/start
Then, launch VMWare Player and run the .vmx file from V:\VM\work\OpenERP_32bits\.
Go on the openerp
menu on the top right corner, then open Paramètres Systèmes, then click on Affichage and then set the resolution to 1280x1024.
Everything has already been done to install OpenERP on you computer, so you can directly jump to 1.4.
Show installation steps 1.1 - 1.2 - 1.3 (attention, don't do these steps, it has already been done on the EFREI Debian virtual machines)
1.1 Add user for OpenERP in Debian
- Create a new user account which will be used to run OpenERP:
- su root
- adduser --system --quiet --shell=/bin/bash --home=/opt/openerp --gecos 'OpenERP' --group openerp
1.2 Install and prepare PostgreSQL
- Install PostgreSQL packages on the system:
- apt-get install postgresql
- apt-get install pgadmin3
- To run OpenERP, PostgreSQL must be forced to use UTF-8 encoding.
The following commands will do this, but never use when some databases already exist because all data would be erased.
Also, 9.1 must be replaced by your PostgreSQL version number:- pg_dropcluster --stop 9.1 main
- pg_createcluster --start -e UTF-8 9.1 main
- Now, add openerp user as a
super user
of PostgreSQL:- su postgres
- createuser openerp
Shall the new role be a superuser? (y/n) y - psql -l
- psql template1
alter role openerp with password 'openerp';
- For GNU/Linux or Unix systems only,
- su root
- With you favourite text editor (kate, gedit, nedit, emacs, vi, …), open the file /etc/postgresql/9.1/main/pg_hba.conf (where, of course, 9.1 should be replaced by your version number), and then replace the line:
local all all ident
by:
local all all md5
- Finally, restart PostgreSQL in order to apply changes:
- service postgresql stop
- service postgresql start
1.3 Install OpenERP server
- Install all dependancies for OpenERP:
- su root
- apt-get install python-dateutil python-feedparser python-gdata python-ldap \
python-libxslt1 python-lxml python-mako python-openid python-psycopg2 \
python-pybabel python-pychart python-pydot python-pyparsing python-reportlab \
python-simplejson python-tz python-vatnumber python-vobject python-webdav \
python-werkzeug python-xlwt python-yaml python-zsi python-docutils \
python-psutil bzr wget python-unittest2 python-mock
- Download last version of gdata-python-client library (check last version number at http://code.google.com/p/gdata-python-client/downloads/list):
- cd /tmp
- wget http://gdata-python-client.googlecode.com/files/gdata-2.0.17.tar.gz
- tar zxvf gdata-2.0.17.tar.gz
- cd gdata-2.0.17/
- python setup.py install
- Download OpenERP 7.0 from Launchpad.net. Three parts must be downloaded: server, addons and web. Once uncompressed, these will occupy arround 260 Mo (36 Mo for server, 209 Mo for addons, and 16 Mo for web). Be patient, the installation will take quite a very long time.
- mkdir /opt/openerp
- su - openerp
- cd /opt/openerp
- bzr checkout lp:openobject-server/7.0 --lightweight server
- bzr checkout lp:openobject-addons/7.0 --lightweight addons
- bzr checkout lp:openerp-web/7.0 --lightweight web
1.4 Launch OpenERP server
If not already done, launch VMWare Player and run Debian.
Numerous options can be given when launching OpenERP server. We gonna give only necessary ones. When using the server in production, we would store the server logs in a specific file (using the --logfile option), but we won't do this for the moment, in order to see in live what the server does.
- cd /opt/openerp
- ./server/openerp-server --xmlrpc-port=40069 --netrpc-port=40070 --addons-path=addons,web/addons --db_user=openerp --db_password=postgres
Exercice 2 • Client side: First connection to OpenERP 7.0
The aim is to explore and discover the OpenERP client.
2.1 Install specific fonts (This step is for Chinese, Japanese and Korean students only)
OpenERP is available with more than 50 translations. In the following you will be about to use OpenERP with your mother thongue. In order to able your web browser to display the fonts for the following languages, some extra packages have to be installed:
Show steps to install fonts (Attention, for Chinese, Japanese and Korean students only)
To install needed packages, open synaptic software as root user (ask me for this password) from a terminal and do one of the following commands:
- Chinese, if you don't see this 简体中文 or this 正體字 correctly then the following packages are needed:
- apt-get install ttf-arphic-bkai00mp ttf-arphic-bsmi00lp ttf-arphic-gkai00mp ttf-arphic-ukai ttf-arphic-uming
- Japanese, if you don't see this 日本語 correctly then the following packages are needed:
- apt-get install ttf-sazanami-mincho ttf-kochi-mincho ttf-takao ttf-takao-gothic ttf-takao-mincho
- Korean, if you don't see this 한국어 correctly then the following package is needed:
- apt-get install ttf-baekmuk
Finally, close all the windows of your web browser (including the present one), and launch it again.
2.2 Connect and create a new database
Launch Iceweasel web browser (not Epiphany):
- Then request OpenERP server to send the start page:
http://127.0.0.1:40069 - If you want to work in English, set the web browser preferences on Edition > Preferences > Contenu > Langages > Choisir and then select English and click on the button
Monter
to put it at top place.
When connecting for the first time, you need to create a new database. In order to fill out the creation form, go on Manage Databases
or, in french, Gestion des bases de données
(Not need if you were already automatically redirected to the form) and then give:
- Master password: admin
- New database name: db_demo
- Load demonstration data: checked
- Admin password: admin
- Click on and wait. It can take quite some time.
After creation, you may automatically be logged in. But for the moment, logout and go to the login page and let's do first some observations:
- You are going to observe and compare the source code of some pages:
- You are on the login page. View the source code of the page (Click on the page with the right button of the mouse and chose the intended menu entry).
- Now, go again on
Manage Databases
or (in french)Gestion des bases de données
, and view the source code of the page. - Now, access the pages
Duplicate database
orBackup database
(by clicking on the left menu), and view the source code of these pages. - Q1: What do you observe about the source codes of all these pages?
Q2: Is this normal? What technology allows the OpenERP client to generate web pages content?
- You are on the login page. View the source code of the page (Click on the page with the right button of the mouse and chose the intended menu entry).
- Now let's have a look to what happened. In a terminal, enter the following commands:
- psql -l
Q3: Who is the owner of db_demo?
Type to exit - psql db_demo openerp (this time the password for openerp role is postgres)
Enter \dt
Use space bar and and to browse result
Q4: What is showing the \dt command?
Q5: How many tables are present in db_demo?
Type to exit - SELECT pg_size_pretty(pg_database_size('db_demo'));
Q6: What is the size of db_demo? - SELECT pg_database_size('db_demo');
Q7: What is the unit used to express the size with this command?
- psql -l
2.3 First steps as administrator
- Type username (admin) and password (admin) and click .
You arrive on the Settings panel.
Q8: What are the 3 main levels of the menu on the left? - Move the mouse cursor over the logo of OpenERP at the top left corner of the page. Then click on Edit Company data.
Change the name of the company for Demo Company.
Change the logo of the company for one of the following (click right button to save the image on your disk):
Save changes and close the pop-up panel.
Then reload page pressing + or pressing .
Q9: What modification can you observe on the page? - There are two different (and not equivalent) ways to install applications in OpenERP 7.0: Apps and Modules
- Read the following article: Modules vs Apps in OpenERP 7.0 (Mantavya Gajjar, February 17, 2013)
- Q10: What is the difference between Apps and Modules?
- Be aware the
OpenERP Apps Store
can be used for free up to 3 users.
- Click in the menu to view Apps. If your computer has internet access, the apps will be listed from the
OpenERP Apps Store
. - Now open Settings > Modules > Installed Modules from the menu.
Q11: How many modules are already installed? - Click on Base module name.
Q12: What informations can you get here?
Q13: What are the available actions?
Q14: In the features tab of this module, can you retreive the 3 menu levels you have listed at question Q8? Under what section can you locate it? - Now, go on Settings > Translations > Load a Translation
and then install the translation for your mother thongue. - Go to Settings > Users > Users
- Click on Demo User to open form. Then click on button of the form.
Change the language of this user for your mother thongue.
In theAccess Rights
tab, set Demo User as a user of Sales application.
Click on button - Click on at top right of the page to reach the Administrator form. Then click again on button of the form.
In theAccess Rights
tab, set Administrator as a user of Sales application.
Click on button.
Now Administrator (the account you are using right now) is a user of sales.
Reload the page pressing + or pressing .
Q15: What sections have appeared at the left of the upper black bar?
- Click on Demo User to open form. Then click on button of the form.
- Go to Sales > Sales > Customers
- Use the arrow of the search bar in order to show Advanced Search panel.
Then, use Group By functionnality in order to display customer by country.
Under the search bar, locate the view options button
Q16: What is the name of the current view?
Now, click to activate the list view.
Click on one of the two persons present in Undefined in order to display its form.
Q17: Why these two persons appear as Undefined when grouping by country? - In the search bar, close the two filters Customers and Country.
Choose kanban view mode.
Using Advanced Search panel, observe, time after time, the entries shown for each of the five filters. - Again in the search bar, close all active filters, and open Advanced Search tool. Then unhide Advanced Search.
Make this search:Country
contains France andIs a Company
is true.
Click the button.
Now, make the current search becoming a new custom filter. Call itFrench companies
.
- Use the arrow of the search bar in order to show Advanced Search panel.
- Log out.
2.4 Log in as user
- Type username (demo) and password (demo) and click .
You arrive on the Sales panel, which is the only one accessible for Demo User for the moment. - Observe the page. Locate some translated terms.
- You may have a warning on the right corner of the page, nearby your login name.
Access the preferences of Demo User.
Then change timezone for Europe/Paris and click . - In order to access the form of Morgan Rose, from Global Solutions, begin to type his name in the search bar, and click on the proposed name.
Then, open his form.
Q18: Are you allowed to edit the form?
Explore the form and observe all the fields offered to parameter the form of this customer. - Go back to the kanban view. Close all filters in the search bar. Perform a new advanced search:
Users
is set.
Q19: How many results are listed? Why the other persons do not appear? - Log out.
2.5 Install modules
- Log as Administrator.
- Go to Settings > Modules > Installed Modules
- Close the filter Installed in the search bar.
- Now you should see all available modules. For the moment, don't click on button
- Clicking on the name of a module, information will be displayed. Then you will be able to go back to the list pressing the kanban view button. Doing so, take some time to explore the forms of the modules listed here.
- Go down the page and find the button. Do this again and again, in order to browse all the modules list.
- Now, choose list mode
Q20: What is total number of modules? - Go back to kanban view. The modules you are going to install are the following:
- Accounting and Finance (When asked during the installation, you will choose French accounting)
- MRP
- Purchase Management
- Sales Management
- Warehouse Management
Q21: You have installed 5 new modules with some preloaded demonstration data. What is the actual size of the database? How many tables are defined?
Q22: What sections are now present in the upper black bar?
Explore each of the new sections (the menus, the forms, the preloaded data, …) by yourself.
- Close the filter Installed in the search bar.
- Go to Settings > Users > Users
Open the form of Demo User and click the button.
Open theAccess Rights
tab.
Observe new applications are available here.
Observe also the different possible access grants existing for each application. - Log out and log in as Demo User.
Take few minutes to explore all the sections, menus, forms, … translated in your mother thongue. - Log out.
2.6 Exporting database
- First, let's save the database.
- On the login page, click
Manage Databases
- Go on Backup
- Type master password: admin
- If the download pop-up appears (after about 5 seconds), then just save the dump file on the hard drive. (If not, you have to go on the terminal where OpenERP server is running, and give the database password: postgres and then finally go back to the web browser to save the dump file).
- On the login page, click
- Now, delete the database db_demo, going at Database Manager > Database Management > Drop
In a terminal, as postgres user, call: psql -l
Q23: What do you observe?
Note : dropping the database can also be done calling: dropdb db_demo - Try going back to login page.
Q24: What happen? Is it normal? - Now, put the database db_demo back in place, going at Database Manager > Database Management > Restore
Fill out the fields and click button.
The page is going to show waiting animation until successfull restore…
(but if nothing happens after waiting 20 seconds, then have a look on the terminal where OpenERP server is running and see if a password is asked. If so, then give database password: postgres Finally, go back to the web browser and wait until succefful restore. ) - Go back to login page, ensure you can log in and check whether everything is in place (the logo, the users, the modules…).
2.7 Technical administration
- Log as Administrator.
- Go to Settings > Users > Users
- Open Administrator user form.
- Click the button, and then activate Technical Features (in the
Access Right
panel) - Click the button, and then reload page pressing + or pressing
- Observe that some menus are now unhidden for Administrator:
- Users > Groups
- Technical
- Configuration
- Something usefull when programmaing, is to know the name and the type of the fields of the object models. To find these informations, all the database structure of loaded modules can be browsed from Settings > Technical > Database Structure > Models
- Click on this menu entry to open the view on the models present in the database.
- Look for the model res.users
- Click on the res.users line to open its form.
- This model allows to represent the data needed to desribe users in OpenERP.
- Observe the fields names and types, and if the fields are required or readonly.
- Open the
Access Rights
tab and observe it. - Open the Views tab and observe it.
- For example, perform the same steps for the following other models:
- res.country : used to describe data for a country in OpenERP.
- res.partner : used to describe data for a partner in OpenERP.
- mrp.bom : used to describe data for a Bill of Material in the MRP module of OpenERP.
- product.product : used to describe data for a product in OpenERP.
Exercice 3 • A complete Sales / Purchase / Manufacturing / Warehouse flow
The aim is perform several steps of a complete business flow.
You are going to follow the instructions described in the chapter 2 of this book:
Els Van Vossel and Fabien Pinckaers, Streamline your Manufacturing Processes with OpenERP, A Simple Approach to Manage the Manufacturing and Supply Chain Complexity, Open Object Press, 2011, 230 pages.
Download chapter 2 in pdf (500 ko).
Remark: This book was written for the version 6 of OpenERP. Event if is is globally the same, there are some small differences with the version 7. So, don't always follow all the insctructions word after word! By example:
- On page 2, to create a
New customer
: in order to be able to fill out the contacts of the company, you must specify that the customer Clarksonis a company
. - On page 4, you will no be able to duplicate some products, because its does not exit. Then first create these missing products (and associate its supplier and procurement method).
- On page 5, for
Minimum stock rules
, you will have to create a newOrder Point
for the product. Also, you will have to enableManage Multiple Warehouse and Locations
from Settings > Warehouse, in order to be able to set the stock location.
While performing the steps of the flow, you will have to answer the following questions:
- Q25: What procurement methods are used in this example? Give a sentence to explain each one.
- Q26: What supply methods have you used?
- Q27: What different categories of products are described here?
- Q28: What is a Bill of Material?
- Q29: In this chapter, the authors talk about real and virtual stocks. What are real and virtual stocks? Explain.
- Q30: As administrator, what access rights would you give in the settings to each of the five users of this example? Fill out the following table.
Name of the user | Thomas | Mitchell | Jason | Randy | Robin | |
---|---|---|---|---|---|---|
Job in the company | ||||||
Access rights for the module |
Sales | |||||
Knowledge | ||||||
Warehouse | ||||||
Manufacturing | ||||||
Accounting & Finance | ||||||
Purchases | ||||||
Human Resources | ||||||
Marketing | ||||||
Fleet | ||||||
Sharing | ||||||
Administration |