1 ========================================
2 Getting started with OpenERP development
3 ========================================
8 Installation from sources
9 ==========================
11 .. _getting_started_installation_source-link:
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.
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::
17 mkdir source;cd source
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::
21 bzr cat -d lp:~openerp-dev/openerp-tools/trunk setup.sh | sh
23 This will create the following two files in your ``source`` directory::
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
28 If you want some help about the available options, please type::
32 Next step is to initialize the shared repository and download the sources. Get the current trunk version of OpenERP by typing::
36 This will create the following structure inside your ``source`` directory, and fetch the latest source code from ``trunk``::
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
46 Some dependencies are necessary to use OpenERP. Depending on your environment, you might have to install the following packages::
48 sudo apt-get install graphviz ghostscript postgresql-client
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
57 Next step is to initialize the database. This will create a new openerp role::
61 Finally, launch the OpenERP server::
65 Testing your installation can be done on http://localhost:8069/ . You should see the OpenERP main login page.
67 .. _Launchpad: https://launchpad.net/
68 .. _Bazaar: http://bazaar.canonical.com/en/
75 ./openerp-server --help
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.
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
105 Database related options
106 ++++++++++++++++++++++++
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
120 Internationalization options
121 ++++++++++++++++++++++++++++
123 Use these options to translate OpenERP to another language.See i18n section of the user manual. Option '-l' is mandatory.::
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
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
137 Options from previous versions
138 ++++++++++++++++++++++++++++++
140 Some options were removed in OpenERP version 6. For example, ``price_accuracy`` is now
141 configured through the :ref:`decimal_accuracy` screen.
146 .. _getting_started_configuration-link:
148 Two configuration files are available:
150 * one for the client: ``~/.openerprc``
151 * one for the server: ``~/.openerp_serverrc``
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 ::
155 ./openerp-server -s or ./openerp-server --save
157 You can specify alternate configuration files with ::
159 -c CONFIG, --config=CONFIG specify alternate config file
161 An example of server configuration file for
166 Command line options example
167 ++++++++++++++++++++++++++++
169 Usage: openerp-server [options]
173 --version show program's version number and exit
174 -h, --help show this help message and exit
178 -c CONFIG, --config=CONFIG
179 specify alternate config file
180 -s, --save save configuration to ~/.openerp_serverrc
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
202 **XML-RPC Configuration**::
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
212 **XML-RPC Secure Configuration**::
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
225 **NET-RPC Configuration**::
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
233 **Web interface Configuration**::
235 --db-filter=REGEXP Filter listed database
237 **Static HTTP service**::
240 enable static HTTP service for serving plain HTML
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 '/')
249 **Testing Configuration**::
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
256 --test-enable Enable YAML and unit tests.
257 --test-commit Commit database changes performed by YAML or XML
260 **Logging Configuration**::
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).
283 **SMTP Configuration**::
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
296 **Database related options**::
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
310 --db-template=DB_TEMPLATE
311 specify a custom database template to create a new
314 **Internationalisation options**::
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
320 --load-language=LOAD_LANGUAGE
321 specifies the languages for the translations you want
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
338 **Security-related options**::
340 --no-database-list disable the ability to return the list of databases
342 **Advanced options**::
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.
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
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
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
376 Server configuration file
377 +++++++++++++++++++++++++
382 addons_path = /home/openerp/workspace/openerp-dev/addons/trunk,/home/openerp/workspace/openerp-dev/web/trunk/addons
384 cache_timeout = 100000
392 db_template = template0
400 log_handler = [':INFO']
403 login_message = False
409 osv_memory_age_limit = 1.0
410 osv_memory_count_limit = False
415 secure_cert_file = server.cert
416 secure_pkey_file = server.pkey
417 server_wide_modules = None
418 smtp_password = False
420 smtp_server = localhost
423 static_http_document_root = None
424 static_http_enable = False
425 static_http_url_prefix = None
430 test_report_directory = False
432 translate_modules = ['all']
434 virtual_memory_limit = 805306368
435 virtual_memory_reset = 671088640