|
We practice the continuous integration (CI), built with the help of [GitLab](https://gitlab.com). The development model we use allows to have safe and stable production branches (similar to the [Git-flow](https://nvie.com/posts/a-successful-git-branching-model/) model). For a code to be merged to the master branch, it must first pass a series of automatic and manual tests. These checks save overall development time, allow to detect bugs and errors at early stages and ensure the high quality of a code.
|
|
|
|
In our development, we follow the [Odoo Guidelines](https://www.odoo.com/documentation/12.0/reference/guidelines.html) and [OCA Guidelines](https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst).
|
|
|
|
|
|
|
|
### Branches
|
|
### Branches
|
|
|
|
|
|
|
|
We have stable production branches (currently 11.0, 12.0). Merging changes directly to stable branches is prohibited.
|
|
|
|
|
|
|
|
Development process happens on the development branches (named `11.0-<branch name>`, `12.0-<branch name>` where `<branch name>` is a description of features developers work on.
|
|
|
|
|
|
|
|
### Code Testing Process
|
|
|
|
|
|
|
|
Any code changes should pass the following stages to be merged into the main branch:
|
|
|
|
|
|
|
|
1. Automatic static code analysis
|
|
|
|
With the following code analyzers:
|
|
|
|
- [bandit](https://github.com/PyCQA/bandit)
|
|
|
|
- [palynt](https://github.com/OCA/pylint-odoo), [flake8](https://github.com/PyCQA/flake8)
|
|
|
|
- [stylelint](https://github.com/stylelint/stylelint)
|
|
|
|
- check-versions (ensure that changes to main branches will change the version of addons)
|
|
|
|
2. Automatic tests
|
|
|
|
- on a clean database
|
|
|
|
- tests with the changes made (migration tests)
|
|
|
|
3. Automatic check of translation coverage
|
|
|
|
4. Automatic review app deployment
|
|
|
|
|
|
|
|
### Translation
|
|
|
|
|
|
|
|
For translations we use [odoo-helper-scripts](https://github.com/katyukha/odoo-helper-scripts) which have `odoo-helper tr` subcommand, that provides utils that simplifies translation process.
|
|
|
|
|
|
|
|
Command `odoo-helper tr regenerate` regenerates PO files for specifed modules.
|
|
|
|
For more info type following in command line
|
|
|
|
|
|
|
|
```bash
|
|
|
|
odoo-helper tr regenerate --help
|
|
|
|
```
|
|
|
|
|
|
|
|
this will display help message for this command.
|
|
|
|
|
|
|
|
For example, we have to translate addon `generic_request_sla` and `generic_request_sla_log` to ukrainian language, so to add translations to that addon we have follow next steps:
|
|
|
|
|
|
|
|
1. `cd repositiories/maao-generic` - go to directory of this repository
|
|
|
|
2. `git checkout 9.0 && git pull` - checkout to branch `9.0` and pull all changes for origin repository.
|
|
|
|
3. `git checkout -b 9.0-translate-request-sla` - start new branch named `9.0-translate-request-sla`
|
|
|
|
4. `odoo-helper tr regenerate --lang uk_UA --file uk generic_request_sla generic_request_sla_log` - regenerate [PO files](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html) for addons `generic_request_sla` and `generic_request_sla_log`, generated files will be `generic_request_sla/i18n/uk.po` and `generic_request_sla_log/i18n/uk.po`. In this command `uk_UA` is language to regenerate translations for, and `uk` is name of translation files. For example for `uk_UA` language, Odoo will look for `uk_UA.po` file first, and then for `uk.po` file.
|
|
|
|
5. Open `generic_request_sla/i18n/uk.po` file in your favorte text editor (for example [gedit](https://wiki.gnome.org/Apps/Gedit), [Sublime text](https://www.sublimetext.com/), etc) and edit translations. Also look here for [PO file format](https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html)
|
|
|
|
6. `git diff --color` - look at your changes, review them before commit, may be you forget to translate something, or there some mistages present in diff.
|
|
|
|
7. Check your translations on your local database, if they looks realy good.
|
|
|
|
***TODO: add here more info, or add link to separate page that describes how to update translations on local database***
|
|
|
|
8. `git commit` Commit your changes, metion in commit message what addons you have translated, are this translations complete, or it is partialy translated. Note, that commit message must be in English!
|
|
|
|
9. `git push -u orgin 9.0-translate-request-sla`
|
|
|
|
10. Go to gitlab and create Merge request (`9.0-translate-request-sla` to `9.0`), wait for tests finished. If you have no finished your work, mark merge request as WIP (work in progress), to prevent it to be merged.
|
|
|
|
11. After tests complete, go to runbot, and test how your translations look. |
|
|
|
\ No newline at end of file |