[DOC] getting_started: improved content
[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 client
40   drwxrwxr-x  3 openerp openerp 4096 2012-04-17 11:10 client-web
41   drwxrwxr-x  2 openerp openerp 4096 2012-04-17 11:10 dump
42   drwxrwxr-x  3 openerp openerp 4096 2012-04-17 11:10 misc
43   drwxrwxr-x  3 openerp openerp 4096 2012-04-17 11:10 server
44   drwxrwxr-x  3 openerp openerp 4096 2012-04-17 11:10 web
45
46 Some dependencies are necessary to use OpenERP. Depending on your environment, you might have to install the following packages::
47
48   sudo apt-get install graphviz ghostscript postgresql-client
49  
50   sudo apt-get install python-dateutil python-feedparser python-gdata
51     python-ldap python-libxslt1 python-lxml python-mako, python-openid
52     python-psycopg2 python-pybabel python-pychart python-pydot
53     python-pyparsing python-reportlab python-simplejson python-tz
54     python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt
55     python-yaml python-zsi python-imaging python-matplotlib 
56
57 Next step is to initialize the database. This will create a new openerp role::
58
59   make db-setup
60
61 Finally, launch the OpenERP server::
62
63   make server
64
65 Testing your installation can be done on http://localhost:8069/ . You should see the OpenERP main login page.
66
67 .. _Launchpad: https://launchpad.net/
68 .. _Bazaar: http://bazaar.canonical.com/en/
69
70 Command line options
71 ====================
72
73 Using the command ::
74
75   ./openerp-server --help
76
77 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.
78
79 General Options
80 +++++++++++++++
81
82 ::
83
84   --version                           show program version number and exit
85   -h, --help                          show this help message and exit
86   -c CONFIG, --config=CONFIG          specify alternate config file
87   -s, --save                          save configuration to ~/.terp_serverrc
88   -v, --verbose                       enable debugging
89   --pidfile=PIDFILE                   file where the server pid will be stored
90   --logfile=LOGFILE                   file where the server log will be stored
91   -n INTERFACE, --interface=INTERFACE specify the TCP IP address
92   -p PORT, --port=PORT                specify the TCP port
93   --net_interface=NETINTERFACE        specify the TCP IP address for netrpc
94   --net_port=NETPORT                  specify the TCP port for netrpc
95   --no-netrpc                         disable netrpc
96   --no-xmlrpc                         disable xmlrpc
97   -i INIT, --init=INIT                init a module (use "all" for all modules)
98   --without-demo=WITHOUT_DEMO         load demo data for a module (use "all" for all modules)
99   -u UPDATE, --update=UPDATE          update a module (use "all" for all modules)
100   --stop-after-init                   stop the server after it initializes
101   --debug                             enable debug mode
102   -S, --secure                        launch server over https instead of http
103   --smtp=SMTP_SERVER                  specify the SMTP server for sending mail
104  
105 Database related options
106 ++++++++++++++++++++++++
107
108 ::
109
110   -d DB_NAME, --database=DB_NAME
111                         specify the database name
112   -r DB_USER, --db_user=DB_USER
113                         specify the database user name
114   -w DB_PASSWORD, --db_password=DB_PASSWORD
115                         specify the database password
116   --pg_path=PG_PATH   specify the pg executable path
117   --db_host=DB_HOST   specify the database host
118   --db_port=DB_PORT   specify the database port
119  
120 Internationalization options
121 ++++++++++++++++++++++++++++
122
123 Use these options to translate OpenERP to another language.See i18n section of the user manual. Option '-l' is mandatory.::
124  
125   -l LANGUAGE, --language=LANGUAGE
126                        specify the language of the translation file. Use it
127                        with --i18n-export and --i18n-import
128   --i18n-export=TRANSLATE_OUT
129                        export all sentences to be translated to a CSV file
130                        and exit
131   --i18n-import=TRANSLATE_IN
132                        import a CSV file with translations and exit
133   --modules=TRANSLATE_MODULES
134                        specify modules to export. Use in combination with
135                        --i18n-export
136
137 Options from previous versions
138 ++++++++++++++++++++++++++++++
139
140 Some options were removed in OpenERP version 6. For example, ``price_accuracy`` is now
141 configured through the :ref:`decimal_accuracy` screen.
142
143 Configuration
144 ==============
145
146 .. _getting_started_configuration-link:
147
148 Two configuration files are available:
149
150     * one for the client: ``~/.openerprc``
151     * one for the server: ``~/.openerp_serverrc``
152
153 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 ::
154
155   ./openerp-server -s or ./openerp-server --save
156
157 You can specify alternate configuration files with ::
158
159   -c CONFIG, --config=CONFIG specify alternate config file
160
161 An example of server configuration file for 
162
163 Appendix
164 ========
165
166 Command line options example
167 ++++++++++++++++++++++++++++
168
169 Usage: openerp-server [options]
170
171 **Options**::
172
173   --version             show program's version number and exit
174   -h, --help            show this help message and exit
175
176 **Common options**::
177
178     -c CONFIG, --config=CONFIG
179                         specify alternate config file
180     -s, --save          save configuration to ~/.openerp_serverrc
181     -i INIT, --init=INIT
182                         install one or more modules (comma-separated list, use
183                         "all" for all modules), requires -d
184     -u UPDATE, --update=UPDATE
185                         update one or more modules (comma-separated list, use
186                         "all" for all modules). Requires -d.
187     --without-demo=WITHOUT_DEMO
188                         disable loading demo data for modules to be installed
189                         (comma-separated, use "all" for all modules). Requires
190                         -d and -i. Default is none
191     -P IMPORT_PARTIAL, --import-partial=IMPORT_PARTIAL
192                         Use this for big data importation, if it crashes you
193                         will be able to continue at the current state. Provide
194                         a filename to store intermediate importation states.
195     --pidfile=PIDFILE   file where the server pid will be stored
196     --addons-path=ADDONS_PATH
197                         specify additional addons paths (separated by commas).
198     --load=SERVER_WIDE_MODULES
199                         Comma-separated list of server-wide modules
200                         default=web
201
202 **XML-RPC Configuration**::
203
204     --xmlrpc-interface=XMLRPC_INTERFACE
205                         Specify the TCP IP address for the XML-RPC protocol.
206                         The empty string binds to all interfaces.
207     --xmlrpc-port=XMLRPC_PORT
208                         specify the TCP port for the XML-RPC protocol
209     --no-xmlrpc         disable the XML-RPC protocol
210     --proxy-mode        Enable correct behavior when behind a reverse proxy
211
212 **XML-RPC Secure Configuration**::
213
214     --xmlrpcs-interface=XMLRPCS_INTERFACE
215                         Specify the TCP IP address for the XML-RPC Secure
216                         protocol. The empty string binds to all interfaces.
217     --xmlrpcs-port=XMLRPCS_PORT
218                         specify the TCP port for the XML-RPC Secure protocol
219     --no-xmlrpcs        disable the XML-RPC Secure protocol
220     --cert-file=SECURE_CERT_FILE
221                         specify the certificate file for the SSL connection
222     --pkey-file=SECURE_PKEY_FILE
223                         specify the private key file for the SSL connection
224
225 **NET-RPC Configuration**::
226
227     --netrpc-interface=NETRPC_INTERFACE
228                         specify the TCP IP address for the NETRPC protocol
229     --netrpc-port=NETRPC_PORT
230                         specify the TCP port for the NETRPC protocol
231     --no-netrpc         disable the NETRPC protocol
232
233 **Web interface Configuration**::
234
235     --db-filter=REGEXP  Filter listed database
236
237 **Static HTTP service**::
238
239     --static-http-enable
240                         enable static HTTP service for serving plain HTML
241                         files
242     --static-http-document-root=STATIC_HTTP_DOCUMENT_ROOT
243                         specify the directory containing your static HTML
244                         files (e.g '/var/www/')
245     --static-http-url-prefix=STATIC_HTTP_URL_PREFIX
246                         specify the URL root prefix where you want web
247                         browsers to access your static HTML files (e.g '/')
248
249 **Testing Configuration**::
250
251     --test-file=TEST_FILE
252                         Launch a YML test file.
253     --test-report-directory=TEST_REPORT_DIRECTORY
254                         If set, will save sample of all reports in this
255                         directory.
256     --test-enable       Enable YAML and unit tests.
257     --test-commit       Commit database changes performed by YAML or XML
258                         tests.
259
260 **Logging Configuration**::
261
262     --logfile=LOGFILE   file where the server log will be stored
263     --no-logrotate      do not rotate the logfile
264     --syslog            Send the log to the syslog server
265     --log-handler=PREFIX:LEVEL
266                         setup a handler at LEVEL for a given PREFIX. An empty
267                         PREFIX indicates the root logger. This option can be
268                         repeated. Example: "openerp.orm:DEBUG" or
269                         "werkzeug:CRITICAL" (default: ":INFO")
270     --log-request       shortcut for --log-
271                         handler=openerp.netsvc.rpc.request:DEBUG
272     --log-response      shortcut for --log-
273                         handler=openerp.netsvc.rpc.response:DEBUG
274     --log-web           shortcut for --log-
275                         handler=openerp.addons.web.common.http:DEBUG
276     --log-sql           shortcut for --log-handler=openerp.sql_db:DEBUG
277     --log-level=LOG_LEVEL
278                         specify the level of the logging. Accepted values:
279                         ['info', 'debug_rpc', 'warn', 'test', 'critical',
280                         'debug_sql', 'error', 'debug', 'debug_rpc_answer',
281                         'notset'] (deprecated option).
282
283 **SMTP Configuration**::
284
285     --email-from=EMAIL_FROM
286                         specify the SMTP email address for sending email
287     --smtp=SMTP_SERVER  specify the SMTP server for sending email
288     --smtp-port=SMTP_PORT
289                         specify the SMTP port
290     --smtp-ssl          specify the SMTP server support SSL or not
291     --smtp-user=SMTP_USER
292                         specify the SMTP username for sending email
293     --smtp-password=SMTP_PASSWORD
294                         specify the SMTP password for sending email
295
296 **Database related options**::
297
298     -d DB_NAME, --database=DB_NAME
299                         specify the database name
300     -r DB_USER, --db_user=DB_USER
301                         specify the database user name
302     -w DB_PASSWORD, --db_password=DB_PASSWORD
303                         specify the database password
304     --pg_path=PG_PATH   specify the pg executable path
305     --db_host=DB_HOST   specify the database host
306     --db_port=DB_PORT   specify the database port
307     --db_maxconn=DB_MAXCONN
308                         specify the the maximum number of physical connections
309                         to posgresql
310     --db-template=DB_TEMPLATE
311                         specify a custom database template to create a new
312                         database
313
314 **Internationalisation options**::
315
316     Use these options to translate OpenERP to another language.See i18n
317     section of the user manual. Option '-d' is mandatory.Option '-l' is
318     mandatory in case of importation
319
320     --load-language=LOAD_LANGUAGE
321                         specifies the languages for the translations you want
322                         to be loaded
323     -l LANGUAGE, --language=LANGUAGE
324                         specify the language of the translation file. Use it
325                         with --i18n-export or --i18n-import
326     --i18n-export=TRANSLATE_OUT
327                         export all sentences to be translated to a CSV file, a
328                         PO file or a TGZ archive and exit
329     --i18n-import=TRANSLATE_IN
330                         import a CSV or a PO file with translations and exit.
331                         The '-l' option is required.
332     --i18n-overwrite    overwrites existing translation terms on updating a
333                         module or importing a CSV or a PO file.
334     --modules=TRANSLATE_MODULES
335                         specify modules to export. Use in combination with
336                         --i18n-export
337
338 **Security-related options**::
339
340     --no-database-list  disable the ability to return the list of databases
341
342 **Advanced options**::
343
344     --cache-timeout=CACHE_TIMEOUT
345                         set the timeout for the cache system
346     --debug             enable debug mode
347     --stop-after-init   stop the server after its initialization
348     -t TIMEZONE, --timezone=TIMEZONE
349                         specify reference timezone for the server (e.g.
350                         Europe/Brussels
351     --osv-memory-count-limit=OSV_MEMORY_COUNT_LIMIT
352                         Force a limit on the maximum number of records kept in
353                         the virtual osv_memory tables. The default is False,
354                         which means no count-based limit.
355     --osv-memory-age-limit=OSV_MEMORY_AGE_LIMIT
356                         Force a limit on the maximum age of records kept in
357                         the virtual osv_memory tables. This is a decimal value
358                         expressed in hours, and the default is 1 hour.
359     --max-cron-threads=MAX_CRON_THREADS
360                         Maximum number of threads processing concurrently cron
361                         jobs.
362     --virtual-memory-limit=VIRTUAL_MEMORY_LIMIT
363                         Maximum allowed virtual memory per Gunicorn process.
364                         When the limit is reached, any memory allocation will
365                         fail.
366     --virtual-memory-reset=VIRTUAL_MEMORY_RESET
367                         Maximum allowed virtual memory per Gunicorn process.
368                         When the limit is reached, the worker will be reset
369                         after the current request.
370     --cpu-time-limit=CPU_TIME_LIMIT
371                         Maximum allowed CPU time per Gunicorn process. When
372                         the limit is reached, an exception is raised.
373     --unaccent          Use the unaccent function provided by the database
374                         when available.
375
376 Server configuration file
377 +++++++++++++++++++++++++
378
379 ::
380
381   [options]
382   addons_path = /home/openerp/workspace/openerp-dev/addons/trunk,/home/openerp/workspace/openerp-dev/web/trunk/addons
383   admin_passwd = admin
384   cache_timeout = 100000
385   cpu_time_limit = 60
386   csv_internal_sep = ,
387   db_host = False
388   db_maxconn = 64
389   db_name = False
390   db_password = False
391   db_port = False
392   db_template = template0
393   db_user = openerp
394   dbfilter = .*
395   debug_mode = False
396   demo = {}
397   email_from = False
398   import_partial = 
399   list_db = True
400   log_handler = [':INFO']
401   log_level = info
402   logfile = False
403   login_message = False
404   logrotate = True
405   max_cron_threads = 4
406   netrpc = True
407   netrpc_interface = 
408   netrpc_port = 8070
409   osv_memory_age_limit = 1.0
410   osv_memory_count_limit = False
411   pg_path = None
412   pidfile = False
413   proxy_mode = False
414   reportgz = False
415   secure_cert_file = server.cert
416   secure_pkey_file = server.pkey
417   server_wide_modules = None
418   smtp_password = False
419   smtp_port = 25
420   smtp_server = localhost
421   smtp_ssl = False
422   smtp_user = False
423   static_http_document_root = None
424   static_http_enable = False
425   static_http_url_prefix = None
426   syslog = False
427   test_commit = False
428   test_enable = False
429   test_file = False
430   test_report_directory = False
431   timezone = False
432   translate_modules = ['all']
433   unaccent = False
434   virtual_memory_limit = 805306368
435   virtual_memory_reset = 671088640
436   without_demo = False
437   xmlrpc = True
438   xmlrpc_interface = 
439   xmlrpc_port = 8069
440   xmlrpcs = True
441   xmlrpcs_interface = 
442   xmlrpcs_port = 8071