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 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
43 Some dependencies are necessary to use OpenERP. Depending on your environment, you might have to install the following packages::
45 sudo apt-get install graphviz ghostscript postgresql-client
47 sudo apt-get install python-dateutil python-feedparser python-gdata
48 python-ldap python-libxslt1 python-lxml python-mako, python-openid
49 python-psycopg2 python-pybabel python-pychart python-pydot
50 python-pyparsing python-reportlab python-simplejson python-tz
51 python-vatnumber python-vobject python-webdav python-werkzeug python-xlwt
52 python-yaml python-imaging python-matplotlib
54 Next step is to initialize the database. This will create a new openerp role::
58 Finally, launch the OpenERP server::
62 Testing your installation can be done on http://localhost:8069/ . You should see the OpenERP main login page.
64 .. _Launchpad: https://launchpad.net/
65 .. _Bazaar: http://bazaar.canonical.com/en/
72 ./openerp-server --help
74 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.
81 --version show program version number and exit
82 -h, --help show this help message and exit
83 -c CONFIG, --config=CONFIG specify alternate config file
84 -s, --save save configuration to ~/.terp_serverrc
85 -v, --verbose enable debugging
86 --pidfile=PIDFILE file where the server pid will be stored
87 --logfile=LOGFILE file where the server log will be stored
88 -n INTERFACE, --interface=INTERFACE specify the TCP IP address
89 -p PORT, --port=PORT specify the TCP port
90 --net_interface=NETINTERFACE specify the TCP IP address for netrpc
91 --net_port=NETPORT specify the TCP port for netrpc
92 --no-netrpc disable netrpc
93 --no-xmlrpc disable xmlrpc
94 -i INIT, --init=INIT init a module (use "all" for all modules)
95 --without-demo=WITHOUT_DEMO load demo data for a module (use "all" for all modules)
96 -u UPDATE, --update=UPDATE update a module (use "all" for all modules)
97 --stop-after-init stop the server after it initializes
98 --debug enable debug mode
99 -S, --secure launch server over https instead of http
100 --smtp=SMTP_SERVER specify the SMTP server for sending mail
102 Database related options
103 ++++++++++++++++++++++++
107 -d DB_NAME, --database=DB_NAME
108 specify the database name
109 -r DB_USER, --db_user=DB_USER
110 specify the database user name
111 -w DB_PASSWORD, --db_password=DB_PASSWORD
112 specify the database password
113 --pg_path=PG_PATH specify the pg executable path
114 --db_host=DB_HOST specify the database host
115 --db_port=DB_PORT specify the database port
117 Internationalization options
118 ++++++++++++++++++++++++++++
120 Use these options to translate OpenERP to another language.See i18n section of the user manual. Option '-l' is mandatory.::
122 -l LANGUAGE, --language=LANGUAGE
123 specify the language of the translation file. Use it
124 with --i18n-export and --i18n-import
125 --i18n-export=TRANSLATE_OUT
126 export all sentences to be translated to a CSV file
128 --i18n-import=TRANSLATE_IN
129 import a CSV file with translations and exit
130 --modules=TRANSLATE_MODULES
131 specify modules to export. Use in combination with
134 Options from previous versions
135 ++++++++++++++++++++++++++++++
137 Some options were removed in OpenERP version 6. For example, ``price_accuracy`` is now
138 configured through the :ref:`decimal_accuracy` screen.
143 .. _getting_started_configuration-link:
145 Two configuration files are available:
147 * one for the client: ``~/.openerprc``
148 * one for the server: ``~/.openerp_serverrc``
150 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 ::
152 ./openerp-server -s or ./openerp-server --save
154 You can specify alternate configuration files with ::
156 -c CONFIG, --config=CONFIG specify alternate config file
161 .. versionadded:: 6.1
163 To run the OpenERP server, the conventional approach is to use the
164 `openerp-server` script. It loads the :ref:`openerp library`, sets a few
165 configuration variables corresponding to command-line arguments, and starts to
166 listen to incoming connections from clients.
168 Depending on your deployment needs, you can write such a start-up script very
169 easily. We also recommend you take a look at an alternative tool called
170 `openerp-command` that can, among other things, launch the server.
172 Yet another alternative is to use a WSGI-compatible HTTP server and let it call
173 into one of the WSGI entry points of the server.
179 Command line options example
180 ++++++++++++++++++++++++++++
182 Usage: openerp-server [options]
186 --version show program's version number and exit
187 -h, --help show this help message and exit
191 -c CONFIG, --config=CONFIG
192 specify alternate config file
193 -s, --save save configuration to ~/.openerp_serverrc
195 install one or more modules (comma-separated list, use
196 "all" for all modules), requires -d
197 -u UPDATE, --update=UPDATE
198 update one or more modules (comma-separated list, use
199 "all" for all modules). Requires -d.
200 --without-demo=WITHOUT_DEMO
201 disable loading demo data for modules to be installed
202 (comma-separated, use "all" for all modules). Requires
203 -d and -i. Default is none
204 -P IMPORT_PARTIAL, --import-partial=IMPORT_PARTIAL
205 Use this for big data importation, if it crashes you
206 will be able to continue at the current state. Provide
207 a filename to store intermediate importation states.
208 --pidfile=PIDFILE file where the server pid will be stored
209 --addons-path=ADDONS_PATH
210 specify additional addons paths (separated by commas).
211 --load=SERVER_WIDE_MODULES
212 Comma-separated list of server-wide modules
215 **XML-RPC Configuration**::
217 --xmlrpc-interface=XMLRPC_INTERFACE
218 Specify the TCP IP address for the XML-RPC protocol.
219 The empty string binds to all interfaces.
220 --xmlrpc-port=XMLRPC_PORT
221 specify the TCP port for the XML-RPC protocol
222 --no-xmlrpc disable the XML-RPC protocol
223 --proxy-mode Enable correct behavior when behind a reverse proxy
225 **XML-RPC Secure Configuration**::
227 --xmlrpcs-interface=XMLRPCS_INTERFACE
228 Specify the TCP IP address for the XML-RPC Secure
229 protocol. The empty string binds to all interfaces.
230 --xmlrpcs-port=XMLRPCS_PORT
231 specify the TCP port for the XML-RPC Secure protocol
232 --no-xmlrpcs disable the XML-RPC Secure protocol
233 --cert-file=SECURE_CERT_FILE
234 specify the certificate file for the SSL connection
235 --pkey-file=SECURE_PKEY_FILE
236 specify the private key file for the SSL connection
238 **NET-RPC Configuration**::
240 --netrpc-interface=NETRPC_INTERFACE
241 specify the TCP IP address for the NETRPC protocol
242 --netrpc-port=NETRPC_PORT
243 specify the TCP port for the NETRPC protocol
244 --no-netrpc disable the NETRPC protocol
246 **Web interface Configuration**::
248 --db-filter=REGEXP Filter listed database
250 **Static HTTP service**::
253 enable static HTTP service for serving plain HTML
255 --static-http-document-root=STATIC_HTTP_DOCUMENT_ROOT
256 specify the directory containing your static HTML
257 files (e.g '/var/www/')
258 --static-http-url-prefix=STATIC_HTTP_URL_PREFIX
259 specify the URL root prefix where you want web
260 browsers to access your static HTML files (e.g '/')
262 **Testing Configuration**::
264 --test-file=TEST_FILE
265 Launch a YML test file.
266 --test-report-directory=TEST_REPORT_DIRECTORY
267 If set, will save sample of all reports in this
269 --test-enable Enable YAML and unit tests.
270 --test-commit Commit database changes performed by YAML or XML
273 **Logging Configuration**::
275 --logfile=LOGFILE file where the server log will be stored
276 --no-logrotate do not rotate the logfile
277 --syslog Send the log to the syslog server
278 --log-handler=PREFIX:LEVEL
279 setup a handler at LEVEL for a given PREFIX. An empty
280 PREFIX indicates the root logger. This option can be
281 repeated. Example: "openerp.orm:DEBUG" or
282 "werkzeug:CRITICAL" (default: ":INFO")
283 --log-request shortcut for --log-
284 handler=openerp.netsvc.rpc.request:DEBUG
285 --log-response shortcut for --log-
286 handler=openerp.netsvc.rpc.response:DEBUG
287 --log-web shortcut for --log-
288 handler=openerp.addons.web.common.http:DEBUG
289 --log-sql shortcut for --log-handler=openerp.sql_db:DEBUG
290 --log-level=LOG_LEVEL
291 specify the level of the logging. Accepted values:
292 ['info', 'debug_rpc', 'warn', 'test', 'critical',
293 'debug_sql', 'error', 'debug', 'debug_rpc_answer',
294 'notset'] (deprecated option).
296 **SMTP Configuration**::
298 --email-from=EMAIL_FROM
299 specify the SMTP email address for sending email
300 --smtp=SMTP_SERVER specify the SMTP server for sending email
301 --smtp-port=SMTP_PORT
302 specify the SMTP port
303 --smtp-ssl specify the SMTP server support SSL or not
304 --smtp-user=SMTP_USER
305 specify the SMTP username for sending email
306 --smtp-password=SMTP_PASSWORD
307 specify the SMTP password for sending email
309 **Database related options**::
311 -d DB_NAME, --database=DB_NAME
312 specify the database name
313 -r DB_USER, --db_user=DB_USER
314 specify the database user name
315 -w DB_PASSWORD, --db_password=DB_PASSWORD
316 specify the database password
317 --pg_path=PG_PATH specify the pg executable path
318 --db_host=DB_HOST specify the database host
319 --db_port=DB_PORT specify the database port
320 --db_maxconn=DB_MAXCONN
321 specify the the maximum number of physical connections
323 --db-template=DB_TEMPLATE
324 specify a custom database template to create a new
327 **Internationalisation options**::
329 Use these options to translate OpenERP to another language.See i18n
330 section of the user manual. Option '-d' is mandatory.Option '-l' is
331 mandatory in case of importation
333 --load-language=LOAD_LANGUAGE
334 specifies the languages for the translations you want
336 -l LANGUAGE, --language=LANGUAGE
337 specify the language of the translation file. Use it
338 with --i18n-export or --i18n-import
339 --i18n-export=TRANSLATE_OUT
340 export all sentences to be translated to a CSV file, a
341 PO file or a TGZ archive and exit
342 --i18n-import=TRANSLATE_IN
343 import a CSV or a PO file with translations and exit.
344 The '-l' option is required.
345 --i18n-overwrite overwrites existing translation terms on updating a
346 module or importing a CSV or a PO file.
347 --modules=TRANSLATE_MODULES
348 specify modules to export. Use in combination with
351 **Security-related options**::
353 --no-database-list disable the ability to return the list of databases
355 **Advanced options**::
357 --cache-timeout=CACHE_TIMEOUT
358 set the timeout for the cache system
359 --debug enable debug mode
360 --stop-after-init stop the server after its initialization
361 -t TIMEZONE, --timezone=TIMEZONE
362 specify reference timezone for the server (e.g.
364 --osv-memory-count-limit=OSV_MEMORY_COUNT_LIMIT
365 Force a limit on the maximum number of records kept in
366 the virtual osv_memory tables. The default is False,
367 which means no count-based limit.
368 --osv-memory-age-limit=OSV_MEMORY_AGE_LIMIT
369 Force a limit on the maximum age of records kept in
370 the virtual osv_memory tables. This is a decimal value
371 expressed in hours, and the default is 1 hour.
372 --max-cron-threads=MAX_CRON_THREADS
373 Maximum number of threads processing concurrently cron
375 --virtual-memory-limit=VIRTUAL_MEMORY_LIMIT
376 Maximum allowed virtual memory per Gunicorn process.
377 When the limit is reached, any memory allocation will
379 --virtual-memory-reset=VIRTUAL_MEMORY_RESET
380 Maximum allowed virtual memory per Gunicorn process.
381 When the limit is reached, the worker will be reset
382 after the current request.
383 --cpu-time-limit=CPU_TIME_LIMIT
384 Maximum allowed CPU time per Gunicorn process. When
385 the limit is reached, an exception is raised.
386 --unaccent Use the unaccent function provided by the database
389 Server configuration file
390 +++++++++++++++++++++++++
395 addons_path = /home/openerp/workspace/openerp-dev/addons/trunk,/home/openerp/workspace/openerp-dev/web/trunk/addons
397 cache_timeout = 100000
405 db_template = template0
413 log_handler = [':INFO']
416 login_message = False
422 osv_memory_age_limit = 1.0
423 osv_memory_count_limit = False
428 secure_cert_file = server.cert
429 secure_pkey_file = server.pkey
430 server_wide_modules = None
431 smtp_password = False
433 smtp_server = localhost
436 static_http_document_root = None
437 static_http_enable = False
438 static_http_url_prefix = None
443 test_report_directory = False
445 translate_modules = ['all']
447 virtual_memory_limit = 805306368
448 virtual_memory_reset = 671088640