3
.. i18n: single: database; create
4
.. i18n: single: database
8
single: database; create
11
.. i18n: .. _sect-dbcreate:
13
.. i18n: Database Creation
14
.. i18n: =================
22
.. i18n: Use the technique outlined in this section to create a new database, \ ``openerp_ch01`` \. This
23
.. i18n: database will contain the demonstration data provided with OpenERP and a large proportion of the
24
.. i18n: core OpenERP functionality. You will need to know your super administrator password for this – or
25
.. i18n: you will have to find somebody who does have it to create this database.
28
Use the technique outlined in this section to create a new database, \ ``openerp_ch01`` \. This
29
database will contain the demonstration data provided with OpenERP and a large proportion of the
30
core OpenERP functionality. You will need to know your super administrator password for this – or
31
you will have to find somebody who does have it to create this database.
34
.. i18n: single: password; super-administrator
35
.. i18n: single: password; superadmin
39
single: password; super-administrator
40
single: password; superadmin
42
.. i18n: .. note:: The Super-administrator Password
44
.. i18n: Anyone who knows the super-administrator password has complete access to the data on the server
45
.. i18n: – able to read, change and delete any of the data in any of the databases there.
47
.. i18n: After first installation, the password is ``admin``. This is the hard-coded default, and
48
.. i18n: is used if there is no accessible server configuration file. If your system has been
49
.. i18n: set up so that the server configuration file can be written to by the server, then
50
.. i18n: you can change the password through the client. Or you could deliberately make the
51
.. i18n: configuration file read-only so that there is no prospect of changing it from the client.
52
.. i18n: Either way, a server systems administrator can change it if you forget it.
54
.. i18n: So if your system is set to allow it, you can change the superadmin password through the GTK client
55
.. i18n: from the menu :menuselection:`File --> Databases --> Administrator Password`, or through the
56
.. i18n: web client by logging out (click the :guilabel:`Logout` link), clicking :guilabel:`Databases` on the
57
.. i18n: login screen, and then clicking the :guilabel:`Password` button on the Management screen.
59
.. i18n: The location of the server configuration file is typically defined by starting the server with
60
.. i18n: the ``--config`` command line option.
63
.. note:: The Super-administrator Password
65
Anyone who knows the super-administrator password has complete access to the data on the server
66
– able to read, change and delete any of the data in any of the databases there.
68
After first installation, the password is ``admin``. This is the hard-coded default, and
69
is used if there is no accessible server configuration file. If your system has been
70
set up so that the server configuration file can be written to by the server, then
71
you can change the password through the client. Or you could deliberately make the
72
configuration file read-only so that there is no prospect of changing it from the client.
73
Either way, a server systems administrator can change it if you forget it.
75
So if your system is set to allow it, you can change the superadmin password through the GTK client
76
from the menu :menuselection:`File --> Databases --> Administrator Password`, or through the
77
web client by logging out (click the :guilabel:`Logout` link), clicking :guilabel:`Databases` on the
78
login screen, and then clicking the :guilabel:`Password` button on the Management screen.
80
The location of the server configuration file is typically defined by starting the server with
81
the ``--config`` command line option.
83
.. i18n: .. figure:: images/change_superadmin_pwd.png
85
.. i18n: :align: center
87
.. i18n: *Changing the super-administrator password through the web client*
90
.. figure:: images/change_superadmin_pwd.png
94
*Changing the super-administrator password through the web client*
96
.. i18n: .. _sect-creatingdb:
98
.. i18n: Creating the Database
99
.. i18n: ---------------------
104
Creating the Database
105
---------------------
107
.. i18n: If you are using the GTK client, choose :menuselection:`File --> Databases --> New database` in
108
.. i18n: the menu at the top left. Enter the super-administrator password, then the name of the new database
109
.. i18n: you are creating.
112
If you are using the GTK client, choose :menuselection:`File --> Databases --> New database` in
113
the menu at the top left. Enter the super-administrator password, then the name of the new database
116
.. i18n: .. figure:: images/create_new_db_GTK.png
118
.. i18n: :align: center
120
.. i18n: *Creating a new database through the GTK client*
123
.. figure:: images/create_new_db_GTK.png
127
*Creating a new database through the GTK client*
129
.. i18n: If you are using the web client, click :guilabel:`Databases` on the login screen, then
130
.. i18n: :guilabel:`Create` on the database management page. Enter the super-administrator password, and the
131
.. i18n: name of the new database you are creating.
133
.. i18n: In both cases, you will see a checkbox that determines whether you load demonstration data or not.
134
.. i18n: The consequences of checking this box or not affect the **whole use** of this database.
137
If you are using the web client, click :guilabel:`Databases` on the login screen, then
138
:guilabel:`Create` on the database management page. Enter the super-administrator password, and the
139
name of the new database you are creating.
141
In both cases, you will see a checkbox that determines whether you load demonstration data or not.
142
The consequences of checking this box or not affect the **whole use** of this database.
144
.. i18n: In both cases, you will also see that you can choose the Administrator password. This makes your
145
.. i18n: database quite secure because you can ensure that it is unique from the outset.
146
.. i18n: (In fact many people find it hard to resist ``admin`` as their password!)
149
In both cases, you will also see that you can choose the Administrator password. This makes your
150
database quite secure because you can ensure that it is unique from the outset.
151
(In fact many people find it hard to resist ``admin`` as their password!)
153
.. i18n: Database openerp_ch01
154
.. i18n: ---------------------
157
Database openerp_ch01
158
---------------------
161
.. i18n: pair: account; user
167
.. i18n: Wait for the message showing that the database has been successfully created, along with the user
168
.. i18n: accounts and passwords (\ ``admin/XXXX``\ and \ ``demo/demo``\ ). Now that you have created this
169
.. i18n: database, you can extend it without having to know the super-administrator password.
172
Wait for the message showing that the database has been successfully created, along with the user
173
accounts and passwords (\ ``admin/XXXX``\ and \ ``demo/demo``\ ). Now that you have created this
174
database, you can extend it without having to know the super-administrator password.
177
.. i18n: single: access; LDAP
178
.. i18n: single: LDAP
179
.. i18n: pair: password; username
180
.. i18n: single: access; user
186
pair: password; username
189
.. i18n: .. tip:: User Access
191
.. i18n: The combination of username/password is specific to a single database. If you have administrative
192
.. i18n: rights to a database you can modify all users.
195
.. i18n: single: module; users_ldap
197
.. i18n: Alternatively, you can install the :mod:`users_ldap` module, which manages the authentication of users
198
.. i18n: in LDAP (the Lightweight Directory Access Protocol, a standard system), and connect it to several
199
.. i18n: OpenERP databases. Using this, many databases can share the same user account details.
204
The combination of username/password is specific to a single database. If you have administrative
205
rights to a database you can modify all users.
208
single: module; users_ldap
210
Alternatively, you can install the :mod:`users_ldap` module, which manages the authentication of users
211
in LDAP (the Lightweight Directory Access Protocol, a standard system), and connect it to several
212
OpenERP databases. Using this, many databases can share the same user account details.
214
.. i18n: .. note:: Failure to Create a Database
216
.. i18n: How do you know if you have successfully created your new database?
217
.. i18n: You are told if the database creation has been unsuccessful.
218
.. i18n: If you have entered a database name using prohibited characters (or no name, or too short a name),
219
.. i18n: you will be alerted by the dialog box :guilabel:`Bad database name!` explaining how to correct the error.
220
.. i18n: If you have entered the wrong super-administrator password or a name already in use
221
.. i18n: (some names can be reserved without your knowledge), you will be alerted by the dialog box
222
.. i18n: :guilabel:`Error during database creation!`.
225
.. note:: Failure to Create a Database
227
How do you know if you have successfully created your new database?
228
You are told if the database creation has been unsuccessful.
229
If you have entered a database name using prohibited characters (or no name, or too short a name),
230
you will be alerted by the dialog box :guilabel:`Bad database name!` explaining how to correct the error.
231
If you have entered the wrong super-administrator password or a name already in use
232
(some names can be reserved without your knowledge), you will be alerted by the dialog box
233
:guilabel:`Error during database creation!`.
235
.. i18n: Since this is the first time you have connected to this database, you will be asked a series of questions to
236
.. i18n: define the database parameters. You may choose to :guilabel:`Skip Configuration Wizards` or
237
.. i18n: :guilabel:`Start Configuration`. If you choose to configure your application, you may proceed with the
238
.. i18n: following steps:
241
Since this is the first time you have connected to this database, you will be asked a series of questions to
242
define the database parameters. You may choose to :guilabel:`Skip Configuration Wizards` or
243
:guilabel:`Start Configuration`. If you choose to configure your application, you may proceed with the
246
.. i18n: #. :guilabel:`Configure Your Interface` : select \ ``Simplified`` \ and click :guilabel:`Next`.
248
.. i18n: #. :guilabel:`Configure Your Company Information` : replace the proposed default of \ ``OpenERP S.A.`` \
249
.. i18n: by your own company name, complete as much of your address as you like. You can set the currency that
250
.. i18n: your company uses or leave the default setting. You may also add your company logo which will
251
.. i18n: be visible on reports and other documents. Click :guilabel:`Next`.
253
.. i18n: #. :guilabel:`Install Applications` : check the applications you need and then click :guilabel:`Install`.
254
.. i18n: For now, do not install any application.
257
#. :guilabel:`Configure Your Interface` : select \ ``Simplified`` \ and click :guilabel:`Next`.
259
#. :guilabel:`Configure Your Company Information` : replace the proposed default of \ ``OpenERP S.A.`` \
260
by your own company name, complete as much of your address as you like. You can set the currency that
261
your company uses or leave the default setting. You may also add your company logo which will
262
be visible on reports and other documents. Click :guilabel:`Next`.
264
#. :guilabel:`Install Applications` : check the applications you need and then click :guilabel:`Install`.
265
For now, do not install any application.
267
.. i18n: Once configuration is complete, you are connected to your OpenERP system. Its functionality is very
268
.. i18n: limited because you have selected a :guilabel:`Simplified` interface with no application installed,
269
.. i18n: but this is sufficient to demonstrate that your installation is working.
272
Once configuration is complete, you are connected to your OpenERP system. Its functionality is very
273
limited because you have selected a :guilabel:`Simplified` interface with no application installed,
274
but this is sufficient to demonstrate that your installation is working.
276
.. i18n: .. figure:: images/define_main_co_dlg.png
277
.. i18n: :align: center
280
.. i18n: *Defining your company during initial database configuration*
283
.. figure:: images/define_main_co_dlg.png
287
*Defining your company during initial database configuration*
290
.. i18n: single: database; manage
294
single: database; manage
296
.. i18n: .. _sect-dbmanage:
298
.. i18n: Managing Databases
299
.. i18n: ------------------
307
.. i18n: As a super-administrator, you do not only have rights to create new databases, but also to:
310
As a super-administrator, you do not only have rights to create new databases, but also to:
312
.. i18n: * backup databases,
314
.. i18n: * delete databases,
316
.. i18n: * restore databases.
325
.. i18n: All of these operations can be carried out from the menu :menuselection:`File --> Databases...`
326
.. i18n: in the GTK client, or from the :guilabel:`Databases` button in the web client's
327
.. i18n: :guilabel:`Login` screen.
330
All of these operations can be carried out from the menu :menuselection:`File --> Databases...`
331
in the GTK client, or from the :guilabel:`Databases` button in the web client's
332
:guilabel:`Login` screen.
335
.. i18n: single: database; backup
339
single: database; backup
341
.. i18n: .. tip:: Backup (copy) a Database
343
.. i18n: To make a copy of a database, go to the web :guilabel:`Login` screen and click the :guilabel:`Databases` button.
344
.. i18n: Then click the :guilabel:`Backup` button, select the database you want to copy and enter the super-administrator
345
.. i18n: password. Click the :guilabel:`Backup` button to confirm that you want to copy the database.
348
.. tip:: Backup (copy) a Database
350
To make a copy of a database, go to the web :guilabel:`Login` screen and click the :guilabel:`Databases` button.
351
Then click the :guilabel:`Backup` button, select the database you want to copy and enter the super-administrator
352
password. Click the :guilabel:`Backup` button to confirm that you want to copy the database.
355
.. i18n: single: database; drop
359
single: database; drop
361
.. i18n: .. tip:: Drop (delete) a Database
363
.. i18n: To delete a database, go to the web :guilabel:`Login` screen and click the :guilabel:`Databases` button.
364
.. i18n: Then click the :guilabel:`Drop` button, select the database you want to delete and enter the super-administrator
365
.. i18n: password. Click the :guilabel:`Drop` button to confirm that you want to delete the database.
368
.. tip:: Drop (delete) a Database
370
To delete a database, go to the web :guilabel:`Login` screen and click the :guilabel:`Databases` button.
371
Then click the :guilabel:`Drop` button, select the database you want to delete and enter the super-administrator
372
password. Click the :guilabel:`Drop` button to confirm that you want to delete the database.
375
.. i18n: single: database; restore
379
single: database; restore
381
.. i18n: .. tip:: Restore a Database
383
.. i18n: To restore a database, go to the web :guilabel:`Login` screen and click the :guilabel:`Databases` button.
384
.. i18n: Then click the :guilabel:`Restore` button, click the :guilabel:`Choose File` button to select the database
385
.. i18n: you want to restore. Give the database a name and enter the super-administrator password.
386
.. i18n: Click the :guilabel:`Restore` button to confirm that you want to install a new copy of the selected database.
387
.. i18n: To restore a database, you need to have an existing copy, of course.
390
.. tip:: Restore a Database
392
To restore a database, go to the web :guilabel:`Login` screen and click the :guilabel:`Databases` button.
393
Then click the :guilabel:`Restore` button, click the :guilabel:`Choose File` button to select the database
394
you want to restore. Give the database a name and enter the super-administrator password.
395
Click the :guilabel:`Restore` button to confirm that you want to install a new copy of the selected database.
396
To restore a database, you need to have an existing copy, of course.
399
.. i18n: single: database; duplicate
403
single: database; duplicate
405
.. i18n: .. tip:: Duplicating a Database
407
.. i18n: To duplicate a database, you can:
409
.. i18n: #. make a backup file on your PC from this database.
411
.. i18n: #. restore this database from the backup file on your PC, and give it a new name.
413
.. i18n: This can be a useful way of making a test database from a production database. You can try out the
414
.. i18n: operation of a new configuration, new modules, or just the import of new data.
417
.. tip:: Duplicating a Database
419
To duplicate a database, you can:
421
#. make a backup file on your PC from this database.
423
#. restore this database from the backup file on your PC, and give it a new name.
425
This can be a useful way of making a test database from a production database. You can try out the
426
operation of a new configuration, new modules, or just the import of new data.
429
.. i18n: single: access
435
.. i18n: A system administrator can configure OpenERP to restrict access to some of these database functions
436
.. i18n: so that your security is enhanced in normal production use.
439
A system administrator can configure OpenERP to restrict access to some of these database functions
440
so that your security is enhanced in normal production use.
442
.. i18n: You are now ready to use databases from your installation to familiarize yourself with the
443
.. i18n: administration and use of OpenERP.
446
You are now ready to use databases from your installation to familiarize yourself with the
447
administration and use of OpenERP.
449
.. i18n: New OpenERP Functionality
450
.. i18n: =========================
453
New OpenERP Functionality
454
=========================
456
.. i18n: The database you have created and managed so far is based on the core OpenERP functionality that you
457
.. i18n: installed. The core system is installed in the file system of your OpenERP application server, but
458
.. i18n: only installed into an OpenERP database as you require it, as is described in the next chapter, :ref:`ch-guided`.
461
The database you have created and managed so far is based on the core OpenERP functionality that you
462
installed. The core system is installed in the file system of your OpenERP application server, but
463
only installed into an OpenERP database as you require it, as is described in the next chapter, :ref:`ch-guided`.
465
.. i18n: What if you want to update what is there, or extend what is there with additional modules?
468
What if you want to update what is there, or extend what is there with additional modules?
470
.. i18n: * To update what you have, you would install a new instance of OpenERP using the same techniques as
471
.. i18n: described earlier in this section, :ref:`sect-dbcreate`.
473
.. i18n: * To extend what you have, you would install new modules in the ``addons`` directory of your current
474
.. i18n: OpenERP installation. There are several ways of doing that.
477
* To update what you have, you would install a new instance of OpenERP using the same techniques as
478
described earlier in this section, :ref:`sect-dbcreate`.
480
* To extend what you have, you would install new modules in the ``addons`` directory of your current
481
OpenERP installation. There are several ways of doing that.
484
.. i18n: pair: system; administrator
488
pair: system; administrator
490
.. i18n: In both cases you will need to be a \ ``root`` \ user or \ ``Administrator`` \ of your
491
.. i18n: OpenERP application server.
494
In both cases you will need to be a \ ``root`` \ user or \ ``Administrator`` \ of your
495
OpenERP application server.
497
.. i18n: Extending OpenERP
498
.. i18n: -----------------
504
.. i18n: To extend OpenERP you will need to copy modules into the \ ``addons`` \ directory. That is in
505
.. i18n: your server's \ ``openerp-server`` \ directory (which differs between Windows, Mac and some of the
506
.. i18n: various Linux distributions and not available at all in the Windows all-in-one installer).
509
To extend OpenERP you will need to copy modules into the \ ``addons`` \ directory. That is in
510
your server's \ ``openerp-server`` \ directory (which differs between Windows, Mac and some of the
511
various Linux distributions and not available at all in the Windows all-in-one installer).
514
.. i18n: single: module; product
515
.. i18n: single: module; purchase
519
single: module; product
520
single: module; purchase
522
.. i18n: If you look there you will see existing modules such as :mod:`product` and :mod:`purchase`. A
523
.. i18n: module can be provided in the form of files within a directory or a a zip-format file containing
524
.. i18n: that same directory structure.
527
If you look there you will see existing modules such as :mod:`product` and :mod:`purchase`. A
528
module can be provided in the form of files within a directory or a a zip-format file containing
529
that same directory structure.
531
.. i18n: You can add modules in two main ways – through the server, or through the client.
534
You can add modules in two main ways – through the server, or through the client.
537
.. i18n: pair: system; administration
541
pair: system; administration
543
.. i18n: To add new modules through the server is a conventional system administration task. As \ ``root`` \
544
.. i18n: user or another suitable user, you would put the module in the \ ``addons`` \ directory and change its
545
.. i18n: permissions to match those of the other modules.
548
To add new modules through the server is a conventional system administration task. As \ ``root`` \
549
user or another suitable user, you would put the module in the \ ``addons`` \ directory and change its
550
permissions to match those of the other modules.
552
.. i18n: To add new modules through the client you must first change the permissions of the \ ``addons`` \
553
.. i18n: directory of the server, so that it is writeable by the server. That will enable you to install
554
.. i18n: OpenERP modules using the OpenERP client (a task ultimately carried out on the application
555
.. i18n: server by the server software).
558
To add new modules through the client you must first change the permissions of the \ ``addons`` \
559
directory of the server, so that it is writeable by the server. That will enable you to install
560
OpenERP modules using the OpenERP client (a task ultimately carried out on the application
561
server by the server software).
564
.. i18n: pair: filesystem; permissions
568
pair: filesystem; permissions
570
.. i18n: .. tip:: Changing Permissions
572
.. i18n: A very simple way of changing permissions on the Linux system you are using to develop an OpenERP
573
.. i18n: application is to execute the command sudo chmod 777 <path_to_addons> (where <path_to_addons> is
574
.. i18n: the full path to the addons directory, a location like /usr/lib/python2.5/site-packages/openerp-
575
.. i18n: server/addons).
578
.. tip:: Changing Permissions
580
A very simple way of changing permissions on the Linux system you are using to develop an OpenERP
581
application is to execute the command sudo chmod 777 <path_to_addons> (where <path_to_addons> is
582
the full path to the addons directory, a location like /usr/lib/python2.5/site-packages/openerp-
585
.. i18n: Any user of OpenERP who has access to the relevant administration menus can then upload any new
586
.. i18n: functionality, so you would certainly disable this capability for production use. You will see examples of
587
.. i18n: this uploading as you make your way through this book.
590
Any user of OpenERP who has access to the relevant administration menus can then upload any new
591
functionality, so you would certainly disable this capability for production use. You will see examples of
592
this uploading as you make your way through this book.
594
.. i18n: .. Copyright © Open Object Press. All rights reserved.
597
.. Copyright © Open Object Press. All rights reserved.
599
.. i18n: .. You may take electronic copy of this publication and distribute it if you don't
600
.. i18n: .. change the content. You can also print a copy to be read by yourself only.
603
.. You may take electronic copy of this publication and distribute it if you don't
604
.. change the content. You can also print a copy to be read by yourself only.
606
.. i18n: .. We have contracts with different publishers in different countries to sell and
607
.. i18n: .. distribute paper or electronic based versions of this book (translated or not)
608
.. i18n: .. in bookstores. This helps to distribute and promote the OpenERP product. It
609
.. i18n: .. also helps us to create incentives to pay contributors and authors using author
610
.. i18n: .. rights of these sales.
613
.. We have contracts with different publishers in different countries to sell and
614
.. distribute paper or electronic based versions of this book (translated or not)
615
.. in bookstores. This helps to distribute and promote the OpenERP product. It
616
.. also helps us to create incentives to pay contributors and authors using author
617
.. rights of these sales.
619
.. i18n: .. Due to this, grants to translate, modify or sell this book are strictly
620
.. i18n: .. forbidden, unless Tiny SPRL (representing Open Object Press) gives you a
621
.. i18n: .. written authorisation for this.
624
.. Due to this, grants to translate, modify or sell this book are strictly
625
.. forbidden, unless Tiny SPRL (representing Open Object Press) gives you a
626
.. written authorisation for this.
628
.. i18n: .. Many of the designations used by manufacturers and suppliers to distinguish their
629
.. i18n: .. products are claimed as trademarks. Where those designations appear in this book,
630
.. i18n: .. and Open Object Press was aware of a trademark claim, the designations have been
631
.. i18n: .. printed in initial capitals.
634
.. Many of the designations used by manufacturers and suppliers to distinguish their
635
.. products are claimed as trademarks. Where those designations appear in this book,
636
.. and Open Object Press was aware of a trademark claim, the designations have been
637
.. printed in initial capitals.
639
.. i18n: .. While every precaution has been taken in the preparation of this book, the publisher
640
.. i18n: .. and the authors assume no responsibility for errors or omissions, or for damages
641
.. i18n: .. resulting from the use of the information contained herein.
644
.. While every precaution has been taken in the preparation of this book, the publisher
645
.. and the authors assume no responsibility for errors or omissions, or for damages
646
.. resulting from the use of the information contained herein.
648
.. i18n: .. Published by Open Object Press, Grand Rosière, Belgium
651
.. Published by Open Object Press, Grand Rosière, Belgium