[REF] Added first chapter from dev book: getting started. Rewrote the installation...
[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
49     python-imaging python-matplotlib 
50
51 Next step is to initialize the database. This will create a new openerp role::
52
53   make db-setup
54
55 Finally, launch the OpenERP server::
56
57   make server
58
59 Testing your installation can be done on http://localhost:8069/ . You should see the OpenERP main login page.
60
61 .. _Launchpad: https://launchpad.net/
62 .. _Bazaar: http://bazaar.canonical.com/en/
63
64 Configuration
65 =============
66
67 .. _getrting_started_configuration-link:
68
69 Two configuration files are available:
70
71     * one for the client: ~/.openerprc
72     * one for the server: ~/.openerp_serverrc
73
74 Those files follow the convention used by python's ConfigParser module.
75
76 Lines beginning with "#" or ";" are comments.
77
78 The client configuration file is automatically generated upon the first start. The one of the server can automatically be created using the command: ::
79
80   openerp-server.py -s
81
82 If they are not found, the server and the client will start with the default configuration.
83
84
85 **Server Configuration File**
86
87 The server configuration file .openerp_serverrc is used to save server startup options. Here is the list of the available options:
88
89 :interface:
90     Address to which the server will be bound 
91
92 :port:
93     Port the server will listen on 
94
95 :database:
96     Name of the database to use 
97
98 :user:
99     Username used when connecting to the database 
100
101 :translate_in:
102     File used to translate OpenERP to your language 
103
104 :translate_out:
105     File used to export the language OpenERP use 
106
107 :language:
108     Use this language as the language of the server. This must be specified as an ISO country code, as specified by the W3C. 
109
110 :verbose:
111     Enable debug output 
112
113 :init:
114     init a module (use "all" for all modules) 
115
116 :update:
117     update a module (use "all" for all modules) 
118
119 :upgrade:
120     Upgrade/install/uninstall modules 
121
122 :db_name:
123     specify the database name 
124
125 :db_user:
126     specify the database user name 
127
128 :db_password:
129     specify the database password 
130
131 :pg_path:
132     specify the pg executable path 
133
134 :db_host:
135     specify the database host 
136
137 :db_port:
138     specify the database port 
139
140 :translate_modules:
141     Specify modules to export. Use in combination with --i18n-export 
142
143
144 You can create your own configuration file by specifying -s or --save on the server command line. If you would like to write an alternative configuration file, use -c <config file> or --config=<config file>
145 Here is a basic configuration for a server::
146
147         [options]
148         verbose = False
149         xmlrpc = True
150         database = terp
151         update = {}
152         port = 8069
153         init = {}
154         interface = 127.0.0.1
155         reportgz = False
156
157 Full Example for Server V5.0 ::
158
159         [printer]
160         path = none
161         softpath_html = none
162         preview = True
163         softpath = none
164
165         [logging]
166         output = stdout
167         logger = 
168         verbose = True
169         level = error
170
171         [help]
172         index = http://www.openerp.com/documentation/user-manual/
173         context = http://www.openerp.com/scripts/context_index.php
174
175         [form]
176         autosave = False
177         toolbar = True
178
179         [support]
180         recipient = support@openerp.com
181         support_id = 
182
183         [tip]
184         position = 0
185         autostart = False
186
187         [client]
188         lang = en_US
189         default_path = /home/user
190         filetype = {}
191         theme = none
192         toolbar = icons
193         form_tab_orientation = 0
194         form_tab = top
195
196         [survey]
197         position = 3
198
199         [path]
200         pixmaps = /usr/share/pixmaps/openerp-client/
201         share = /usr/share/openerp-client/
202
203         [login]
204         db = eo2
205         login = admin
206         protocol = http://
207         port = 8069
208         server = localhost
209
210
211 Command line options
212 ====================
213
214 General Options
215 ---------------
216
217   --version             show program version number and exit
218   -h, --help            show this help message and exit
219   -c CONFIG, --config=CONFIG
220                         specify alternate config file
221   -s, --save            save configuration to ~/.terp_serverrc
222   -v, --verbose         enable debugging
223   --pidfile=PIDFILE     file where the server pid will be stored
224   --logfile=LOGFILE     file where the server log will be stored
225   -n INTERFACE, --interface=INTERFACE
226                         specify the TCP IP address
227   -p PORT, --port=PORT  specify the TCP port
228   --net_interface=NETINTERFACE
229                         specify the TCP IP address for netrpc
230   --net_port=NETPORT    specify the TCP port for netrpc
231   --no-netrpc           disable netrpc
232   --no-xmlrpc           disable xmlrpc
233   -i INIT, --init=INIT  init a module (use "all" for all modules)
234   --without-demo=WITHOUT_DEMO
235                         load demo data for a module (use "all" for all
236                         modules)
237   -u UPDATE, --update=UPDATE
238                         update a module (use "all" for all modules)
239   --stop-after-init     stop the server after it initializes
240   --debug               enable debug mode
241   -S, --secure          launch server over https instead of http
242   --smtp=SMTP_SERVER    specify the SMTP server for sending mail
243  
244 Database related options:
245 -------------------------
246  
247   -d DB_NAME, --database=DB_NAME
248                         specify the database name
249   -r DB_USER, --db_user=DB_USER
250                         specify the database user name
251   -w DB_PASSWORD, --db_password=DB_PASSWORD
252                         specify the database password
253   --pg_path=PG_PATH   specify the pg executable path
254   --db_host=DB_HOST   specify the database host
255   --db_port=DB_PORT   specify the database port
256  
257 Internationalization options:
258 -----------------------------
259
260     Use these options to translate OpenERP to another language.See i18n
261     section of the user manual. Option '-l' is mandatory.
262  
263   -l LANGUAGE, --language=LANGUAGE
264                        specify the language of the translation file. Use it
265                        with --i18n-export and --i18n-import
266   --i18n-export=TRANSLATE_OUT
267                        export all sentences to be translated to a CSV file
268                        and exit
269   --i18n-import=TRANSLATE_IN
270                        import a CSV file with translations and exit
271   --modules=TRANSLATE_MODULES
272                        specify modules to export. Use in combination with
273                        --i18n-export
274
275 Options from previous versions:
276 -------------------------------
277 Some options were removed in version 6. For example, ``price_accuracy`` is now
278 configured through the :ref:`decimal_accuracy` screen.
279