|
2 | 2 |
|
3 | 3 | At this moment, here is only basic documentation |
4 | 4 |
|
| 5 | +See also [Quick Start Guide](./quick-start-guide.md) and [Frequently used commands](./frequently-used-commands.md) |
| 6 | + |
5 | 7 | ## odoo-helper-scripts installation |
6 | 8 |
|
7 | 9 | For full list of installation options look at [installation documentation](./installation.md) |
@@ -75,184 +77,3 @@ or its subdirectories. Thus*odoo-helper* could find project/instance [config fil |
75 | 77 |
|
76 | 78 | See [Frequently used commands](./frequently-used-commands.md) for more info about available commands |
77 | 79 | or just run `odoo-helper --help` |
78 | | - |
79 | | - |
80 | | -## Complete example |
81 | | - |
82 | | -Ensure *odoo-helper-scripts* pre-requirements are installed |
83 | | -This step should be usualy ran one time, and is required to ensure that |
84 | | -all odoo-helper dependencies are installed. |
85 | | - |
86 | | -```bash |
87 | | -odoo-helper install pre-requirements |
88 | | -``` |
89 | | - |
90 | | -Install system dependencies for odoo version 10.0 |
91 | | -Note, that this option requires *sudo*. |
92 | | - |
93 | | -```bash |
94 | | -odoo-helper install sys-deps 10.0; |
95 | | -``` |
96 | | - |
97 | | -Install [PostgreSQL Server](https://www.postgresql.org/) and create |
98 | | -postgres user for Odoo with `name='odoo'` and `password='odoo'` |
99 | | - |
100 | | -```bash |
101 | | -odoo-helper install postgres odoo odoo |
102 | | -``` |
103 | | - |
104 | | -Install *Odoo* 10.0 into *odoo-10.0* directory |
105 | | - |
106 | | -```bash |
107 | | -odoo-install -i odoo-10.0 --odoo-version 10.0 |
108 | | -``` |
109 | | - |
110 | | -Change directory to that one contains just installed Odoo instance. |
111 | | -This is required to make instance-management commands work |
112 | | - |
113 | | -```bash |
114 | | -cd odoo-10.0 |
115 | | -``` |
116 | | - |
117 | | -Now You have *Odoo 10.0* installed in this directory. |
118 | | -Note, that this odoo installation uses [virtualenv](https://virtualenv.pypa.io/en/stable/) |
119 | | -(`venv` directory) |
120 | | -Also you will find there `odoo-helper.conf` config file |
121 | | - |
122 | | -So now You can run local odoo server (i.e `openerp-server` or `odoo.py` or `odoo-bin` script). |
123 | | -Note that this command run's server in foreground. |
124 | | -Configuration file `conf/odoo.conf` will be automatically used |
125 | | - |
126 | | -```bash |
127 | | -odoo-helper server run |
128 | | -``` |
129 | | - |
130 | | -Press `Ctrl+C` to stop the server |
131 | | - |
132 | | -To run server in backgroud use following command: |
133 | | - |
134 | | -```bash |
135 | | -odoo-helper server start |
136 | | -``` |
137 | | - |
138 | | -There are also additional server related commands (see [Frequently Used Commands](./frequently-used-commands.md)): |
139 | | - |
140 | | -```bash |
141 | | -odoo-helper server status |
142 | | -odoo-helper server log |
143 | | -odoo-helper server ps |
144 | | -odoo-helper server restart |
145 | | -odoo-helper server stop |
146 | | -``` |
147 | | - |
148 | | -Also there are shourtcuts for these commands |
149 | | - |
150 | | -```bash |
151 | | -odoo-helper status |
152 | | -odoo-helper log |
153 | | -odoo-helper restart |
154 | | -odoo-helper stop |
155 | | -``` |
156 | | - |
157 | | -Let's fetch modules from [OCA repository 'contract'](https://github.com/OCA/contract) |
158 | | -Branch will be detected automatically by *odoo-helper-scripts* |
159 | | - |
160 | | -```bash |
161 | | -odoo-helper fetch --oca contract |
162 | | -``` |
163 | | - |
164 | | -Or alternatively |
165 | | - |
166 | | -```bash |
167 | | -odoo-helper fetch --github OCA/contract --branch 10.0 |
168 | | -``` |
169 | | - |
170 | | -Now look at `custom_addons/` directory, there will be placed links to addons |
171 | | -from [OCA repository 'contract'](https://github.com/OCA/contract) |
172 | | -But repository itself is placed in `repositories/` directory |
173 | | - |
174 | | -Now let's run tests for these just installed modules |
175 | | - |
176 | | -```bash |
177 | | -odoo-helper test --create-test-db -m contract |
178 | | -``` |
179 | | - |
180 | | -This will create *test database* (it will be dropt after tests finished) and |
181 | | -run tests for `contract` module |
182 | | - |
183 | | -Or we can run tests for all addons in specified directory, *odoo-helper-scripts* |
184 | | -will automaticaly detect installable addons and run test for them |
185 | | - |
186 | | -```bash |
187 | | -odoo-helper test --dir ./repositories/contract |
188 | | -``` |
189 | | - |
190 | | -This will use standard test database, that will not be dropt after tests, |
191 | | -so we do not need to recreate database on each test run, which saves time |
192 | | - |
193 | | -If you need color output from Odoo, you may use `--use-unbuffer` option, |
194 | | -but it depends on `unbuffer` program that could be found in `expect-dev` package. |
195 | | - |
196 | | -```bash |
197 | | -odoo-helper --use-unbuffer test -m contract |
198 | | -``` |
199 | | - |
200 | | -The one cool thing of *odoo-helper-scripts*, you may not remeber paths to odoo instalation directory, |
201 | | -and if you change directory to another inside your *Odoo* project, everything will continue to work. |
202 | | - |
203 | | -```bash |
204 | | -cd custom_addons |
205 | | -odoo-helper server status |
206 | | -dooo-helper server restart |
207 | | -``` |
208 | | - |
209 | | -So... let's install one more Odoo version |
210 | | -go back to directory containing your projects (that one, where `odoo-10.0` project is placed in) |
211 | | - |
212 | | -```bash |
213 | | -cd ../../ |
214 | | -``` |
215 | | - |
216 | | -Let's install *Odoo* of version 11.0 here too. |
217 | | -First, install *system dependencies* for *Odoo* version 11.0 |
218 | | - |
219 | | -```bash |
220 | | -odoo-helper install sys-deps 11.0; |
221 | | -``` |
222 | | - |
223 | | -And when system dependencies installed, install *Odoo* itself |
224 | | - |
225 | | -```bash |
226 | | -odoo-install --install-dir odoo-11.0 --odoo-version 11.0 |
227 | | -cd odoo-11.0 |
228 | | -``` |
229 | | - |
230 | | -and install there for example addon [project_task_code](https://github.com/OCA/project/tree/11.0/project_task_code) |
231 | | -from [project](https://github.com/OCA/project) [Odoo Community Association](https://odoo-community.org/) repository |
232 | | -Note that *odoo-helper* script will automaticaly fetch branch named as server version in current install, |
233 | | -if another branch was not specified |
234 | | - |
235 | | -```bash |
236 | | -odoo-helper fetch --oca project -m project_task_code |
237 | | -``` |
238 | | - |
239 | | -and run tests for it |
240 | | - |
241 | | -```bash |
242 | | -odoo-helper test --create-test-db -m project_task_code |
243 | | -``` |
244 | | - |
245 | | -Also if you want to install python packages in current installation environment, |
246 | | -*odoo-helper* provides *pip alias* to *pip* installed in virtualenv of Odoo instance |
247 | | - |
248 | | -```bash |
249 | | -odoo-helper pip install phonenumbers |
250 | | -``` |
251 | | - |
252 | | -and as one more example, let's install aeroo-reports with dependancy to aeroolib in odoo 10.0 |
253 | | - |
254 | | -```bash |
255 | | -cd ../odoo-10.0 |
256 | | -odoo-helper fetch --github gisce/aeroo -n aeroo |
257 | | -odoo-helper fetch -p git+https://github.com/jamotion/aeroolib#egg=aeroolib |
258 | | -``` |
0 commit comments