Use the technique outlined in this section to create a new database, openerp_ch01 . This database will contain the demonstration data provided with OpenERP and a large proportion of the core OpenERP functionality. You will need to know your super administrator password for this – or you will have to find somebody who does have it to create this database.
The Super-administrator Password
Anyone who knows the super-administrator password has complete access to the data on the server – able to read, change and delete any of the data in any of the databases there.
After first installation, the password is admin. This is the hard-coded default, and is used if there is no accessible server configuration file. If your system has been set up so that the server configuration file can be written to by the server, then you can change the password through the client. Or you could deliberately make the configuration file read-only so that there is no prospect of changing it from the client. Either way, a server systems administrator can change it if you forget it.
So if your system is set to allow it, you can change the superadmin password through the GTK client from the menu File ‣ Databases ‣ Administrator Password, or through the web client by logging out (click the Logout link), clicking Databases on the login screen, and then clicking the Password button on the Management screen.
The location of the server configuration file is typically defined by starting the server with the --config command line option.
Creating the Database¶
If you are using the GTK client, choose File ‣ Databases ‣ New database in the menu at the top left. Enter the super-administrator password, then the name of the new database you are creating.
If you are using the web client, click Databases on the login screen, then Create on the database management page. Enter the super-administrator password, and the name of the new database you are creating.
In both cases, you will see a checkbox that determines whether you load demonstration data or not. The consequences of checking this box or not affect the whole use of this database.
In both cases, you will also see that you can choose the Administrator password. This makes your database quite secure because you can ensure that it is unique from the outset. (In fact many people find it hard to resist admin as their password!)
Wait for the message showing that the database has been successfully created, along with the user accounts and passwords (admin/XXXX and demo/demo ). Now that you have created this database, you can extend it without having to know the super-administrator password.
The combination of username/password is specific to a single database. If you have administrative rights to a database you can modify all users.
Alternatively, you can install the users_ldap module, which manages the authentication of users in LDAP (the Lightweight Directory Access Protocol, a standard system), and connect it to several OpenERP databases. Using this, many databases can share the same user account details.
Failure to Create a Database
How do you know if you have successfully created your new database? You are told if the database creation has been unsuccessful. If you have entered a database name using prohibited characters (or no name, or too short a name), you will be alerted by the dialog box Bad database name! explaining how to correct the error. If you have entered the wrong super-administrator password or a name already in use (some names can be reserved without your knowledge), you will be alerted by the dialog box Error during database creation!.
Since this is the first time you have connected to this database, you will be asked a series of questions to define the database parameters. You may choose to Skip Configuration Wizards or Start Configuration. If you choose to configure your application, you may proceed with the following steps:
Configure Your Interface : select Simplified and click Next.
Configure Your Company Information : replace the proposed default of OpenERP S.A. by your own company name, complete as much of your address as you like. You can set the currency that your company uses or leave the default setting. You may also add your company logo which will be visible on reports and other documents. Click Next.
Install Applications : check the applications you need and then click Install. For now, do not install any application.
Once configuration is complete, you are connected to your OpenERP system. Its functionality is very limited because you have selected a Simplified interface with no application installed, but this is sufficient to demonstrate that your installation is working.
As a super-administrator, you do not only have rights to create new databases, but also to:
All of these operations can be carried out from the menu File ‣ Databases... in the GTK client, or from the Databases button in the web client's Login screen.
Backup (copy) a Database
To make a copy of a database, go to the web Login screen and click the Databases button. Then click the Backup button, select the database you want to copy and enter the super-administrator password. Click the Backup button to confirm that you want to copy the database.
Drop (delete) a Database
To delete a database, go to the web Login screen and click the Databases button. Then click the Drop button, select the database you want to delete and enter the super-administrator password. Click the Drop button to confirm that you want to delete the database.
Restore a Database
To restore a database, go to the web Login screen and click the Databases button. Then click the Restore button, click the Choose File button to select the database you want to restore. Give the database a name and enter the super-administrator password. Click the Restore button to confirm that you want to install a new copy of the selected database. To restore a database, you need to have an existing copy, of course.
Duplicating a Database
To duplicate a database, you can:
make a backup file on your PC from this database.
restore this database from the backup file on your PC, and give it a new name.
This can be a useful way of making a test database from a production database. You can try out the operation of a new configuration, new modules, or just the import of new data.
A system administrator can configure OpenERP to restrict access to some of these database functions so that your security is enhanced in normal production use.
You are now ready to use databases from your installation to familiarize yourself with the administration and use of OpenERP.
New OpenERP Functionality¶
The database you have created and managed so far is based on the core OpenERP functionality that you installed. The core system is installed in the file system of your OpenERP application server, but only installed into an OpenERP database as you require it, as is described in the next chapter, Guided Tour.
What if you want to update what is there, or extend what is there with additional modules?
To update what you have, you would install a new instance of OpenERP using the same techniques as described earlier in this section, Database Creation.
To extend what you have, you would install new modules in the addons directory of your current OpenERP installation. There are several ways of doing that.
In both cases you will need to be a root user or Administrator of your OpenERP application server.
To extend OpenERP you will need to copy modules into the addons directory. That is in your server's openerp-server directory (which differs between Windows, Mac and some of the various Linux distributions and not available at all in the Windows all-in-one installer).
If you look there you will see existing modules such as product and purchase. A module can be provided in the form of files within a directory or a a zip-format file containing that same directory structure.
You can add modules in two main ways – through the server, or through the client.
To add new modules through the server is a conventional system administration task. As root user or another suitable user, you would put the module in the addons directory and change its permissions to match those of the other modules.
To add new modules through the client you must first change the permissions of the addons directory of the server, so that it is writeable by the server. That will enable you to install OpenERP modules using the OpenERP client (a task ultimately carried out on the application server by the server software).
A very simple way of changing permissions on the Linux system you are using to develop an OpenERP application is to execute the command sudo chmod 777 <path_to_addons> (where <path_to_addons> is the full path to the addons directory, a location like /usr/lib/python2.5/site-packages/openerp- server/addons).
Any user of OpenERP who has access to the relevant administration menus can then upload any new functionality, so you would certainly disable this capability for production use. You will see examples of this uploading as you make your way through this book.