[FIX] Doc compiled doesn't allow copy and paste, little fix to better use of docs
[odoo/odoo.git] / doc / 01_getting_started.rst
1 ========================================
2 Getting started with OpenERP development
3 ========================================
4
5 .. toctree::
6    :maxdepth: 1
7
8 Installation from sources
9 ==========================
10
11 .. _getting_started_installation_source-link:
12
13 Source code is hosted on Launchpad_. In order to get the sources, you will need Bazaar_ to pull the source from Launchpad. Bazaar is a version control system that helps you track project history over time and collaborate efficiently. You may have to create an account on Launchpad to be able to collaborate on OpenERP development. Please refer to the Launchpad and Bazaar documentation to install and setup your development environment.
14
15 The running example of this section is based on an Ubuntu environment. You may have to adapt the steps according to your system. Once your working environment is ready, prepare a working directory that will contain the sources.  For a ``source`` base directory, type::
16
17   mkdir source;cd source
18
19 OpenERP provides a setup script that automatizes the tasks of creating a shared repository and getting the source code. Get the setup script of OpenERP by typing::
20
21   bzr cat -d lp:~openerp-dev/openerp-tools/trunk setup.sh | sh
22
23 This will create the following two files in your ``source`` directory::
24
25   -rw-rw-r--  1 openerp openerp 5465 2012-04-17 11:05 Makefile
26   -rw-rw-r--  1 openerp openerp 2902 2012-04-17 11:05 Makefile_helper.py
27
28 If you want some help about the available options, please type::
29
30   make help
31
32 Next step is to initialize the shared repository and download the sources. Get the current trunk version of OpenERP by typing::
33
34   make init-trunk
35
36 This will create the following structure inside your ``source`` directory, and fetch the latest source code from ``trunk``::
37
38   drwxrwxr-x  3 openerp openerp 4096 2012-04-17 11:10 addons
39   drwxrwxr-x  3 openerp openerp 4096 2012-04-17 11:10 misc
40   drwxrwxr-x  3 openerp openerp 4096 2012-04-17 11:10 server
41   drwxrwxr-x  3 openerp openerp 4096 2012-04-17 11:10 web
42
43 Some dependencies are necessary to use OpenERP. Depending on your environment, you might have to install the following packages::
44
45   sudo apt-get install \
46             graphviz \
47             ghostscript \
48             postgresql-client \
49             python-dateutil \
50             python-feedparser \
51             python-gdata \
52             python-ldap \
53             python-libxslt1 \
54             python-lxml \
55             python-mako \
56             python-openid \
57             python-psycopg2 \
58             python-pybabel \
59             python-pychart \
60             python-pydot \
61             python-pyparsing \
62             python-reportlab \
63             python-simplejson \
64             python-tz \
65             python-vatnumber \
66             python-vobject \
67             python-webdav \
68             python-werkzeug \
69             python-xlwt \
70             python-yaml \
71             python-imaging \
72             python-matplotlib
73
74 Next step is to initialize the database. This will create a new openerp role::
75
76   make db-setup
77
78 Finally, launch the OpenERP server::
79
80   make server
81
82 Testing your installation can be done on http://localhost:8069/ . You should see the OpenERP main login page.
83
84 .. _Launchpad: https://launchpad.net/
85 .. _Bazaar: http://bazaar.canonical.com/en/
86
87 Command line options
88 ====================
89
90 Using the command ::
91
92   ./openerp-server --help
93
94 gives you the available command line options. For OpenERP server at revision 4133, an output example is given in the `Command line options example`_. Here are a few interesting command line options.
95
96 General Options
97 +++++++++++++++
98
99 ::
100
101   --version                           show program version number and exit
102   -h, --help                          show this help message and exit
103   -c CONFIG, --config=CONFIG          specify alternate config file
104   -s, --save                          save configuration to ~/.terp_serverrc
105   -v, --verbose                       enable debugging
106   --pidfile=PIDFILE                   file where the server pid will be stored
107   --logfile=LOGFILE                   file where the server log will be stored
108   -n INTERFACE, --interface=INTERFACE specify the TCP IP address
109   -p PORT, --port=PORT                specify the TCP port
110   --net_interface=NETINTERFACE        specify the TCP IP address for netrpc
111   --net_port=NETPORT                  specify the TCP port for netrpc
112   --no-netrpc                         disable netrpc
113   --no-xmlrpc                         disable xmlrpc
114   -i INIT, --init=INIT                init a module (use "all" for all modules)
115   --without-demo=WITHOUT_DEMO         load demo data for a module (use "all" for all modules)
116   -u UPDATE, --update=UPDATE          update a module (use "all" for all modules)
117   --stop-after-init                   stop the server after it initializes
118   --debug                             enable debug mode
119   -S, --secure                        launch server over https instead of http
120   --smtp=SMTP_SERVER                  specify the SMTP server for sending mail
121  
122 Database related options
123 ++++++++++++++++++++++++
124
125 ::
126
127   -d DB_NAME, --database=DB_NAME
128                         specify the database name
129   -r DB_USER, --db_user=DB_USER
130                         specify the database user name
131   -w DB_PASSWORD, --db_password=DB_PASSWORD
132                         specify the database password
133   --pg_path=PG_PATH   specify the pg executable path
134   --db_host=DB_HOST   specify the database host
135   --db_port=DB_PORT   specify the database port
136  
137 Internationalization options
138 ++++++++++++++++++++++++++++
139
140 Use these options to translate OpenERP to another language.See i18n section of the user manual. Option '-l' is mandatory.::
141  
142   -l LANGUAGE, --language=LANGUAGE
143                        specify the language of the translation file. Use it
144                        with --i18n-export and --i18n-import
145   --i18n-export=TRANSLATE_OUT
146                        export all sentences to be translated to a CSV file
147                        and exit
148   --i18n-import=TRANSLATE_IN
149                        import a CSV file with translations and exit
150   --modules=TRANSLATE_MODULES
151                        specify modules to export. Use in combination with
152                        --i18n-export
153
154 Options from previous versions
155 ++++++++++++++++++++++++++++++
156
157 Some options were removed in OpenERP version 6. For example, ``price_accuracy`` is now
158 configured through the :ref:`decimal_accuracy` screen.
159
160 Configuration
161 ==============
162
163 .. _getting_started_configuration-link:
164
165 Two configuration files are available:
166
167     * one for the client: ``~/.openerprc``
168     * one for the server: ``~/.openerp_serverrc``
169
170 If they are not found, the server and the client will start with a default configuration. Those files follow the convention used by python's ConfigParser module. Please note that lines beginning with "#" or ";" are comments. The client configuration file is automatically generated upon the first start. The sezrver configuration file can automatically be created using the command ::
171
172   ./openerp-server -s or ./openerp-server --save
173
174 You can specify alternate configuration files with ::
175
176   -c CONFIG, --config=CONFIG specify alternate config file
177
178 Configure addons locations
179 --------------------------
180
181 By default, the only directory of addons known by the server is server/bin/addons. 
182 It is possible to add new addons by
183
184  - copying them in server/bin/addons, or creating a symbolic link to each 
185    of them in this directory, or
186  - specifying another directory containing addons to the server. The later 
187    can be accomplished either by running the server with the ``--addons-path=`` 
188    option, or by configuring this option in the openerp_serverrc file, 
189    automatically generated under Linux in your home directory by the 
190    server when executed with the ``--save`` option. You can provide several 
191    addons to the ``addons_path`` = option, separating them using commas.
192
193 Start-up script
194 ===============
195
196 .. versionadded:: 6.1
197
198 To run the OpenERP server, the conventional approach is to use the
199 `openerp-server` script.  It loads the :ref:`openerp library`, sets a few
200 configuration variables corresponding to command-line arguments, and starts to
201 listen to incoming connections from clients.
202
203 Depending on your deployment needs, you can write such a start-up script very
204 easily. We also recommend you take a look at an alternative tool called
205 `openerp-command` that can, among other things, launch the server.
206
207 Yet another alternative is to use a WSGI-compatible HTTP server and let it call
208 into one of the WSGI entry points of the server.
209
210