├── .github └── workflows │ ├── DINAR2fork.yml │ ├── fork2repos.yml │ └── pre-commit.yml ├── .gitignore ├── .isort.cfg ├── .pre-commit-config.yaml ├── LICENSE ├── README.md ├── config.example.yml ├── editable-files ├── .DINAR │ ├── config.yaml │ └── image │ │ ├── README.md │ │ ├── dependencies │ │ └── pip.txt │ │ └── src │ │ ├── addons.yaml │ │ └── repos.yaml └── .isort.cfg ├── embedded-files └── .DINAR │ ├── .dockerignore │ ├── Dockerfile │ └── image │ └── build.d │ ├── 099-create-netrc │ └── 101-rm-netrc ├── local-files └── docker-compose.override.yml ├── static-files ├── 10.0 │ ├── .pre-commit-config.yaml │ ├── .pylintrc │ └── .pylintrc-mandatory ├── 11.0 │ ├── .pre-commit-config.yaml │ ├── .pylintrc │ └── .pylintrc-mandatory ├── 12.0 │ ├── .pre-commit-config.yaml │ ├── .pylintrc │ └── .pylintrc-mandatory ├── 13.0 │ ├── .pre-commit-config.yaml │ ├── .pylintrc │ └── .pylintrc-mandatory ├── 14.0 │ ├── .pre-commit-config.yaml │ ├── .pylintrc │ └── .pylintrc-mandatory ├── 15.0 │ ├── .pre-commit-config.yaml │ ├── .pylintrc │ └── .pylintrc-mandatory ├── 16.0 │ ├── .pre-commit-config.yaml │ ├── .pylintrc │ └── .pylintrc-mandatory ├── 17.0 │ ├── .pre-commit-config.yaml │ ├── .pylintrc │ └── .pylintrc-mandatory └── all │ ├── .editorconfig │ ├── .eslintrc.yml │ ├── .flake8 │ ├── .github │ └── workflows │ │ ├── DINAR-PORT.yml │ │ ├── DINAR-pr.yml │ │ └── DINAR.yml │ └── .prettierrc.yml └── workflow-files ├── analyze-modules.py ├── analyze_port_trigger.py ├── branch2odoo_version.py ├── configure-docker.sh ├── docker-compose-DINAR-pr.yml ├── docker-compose-DINAR.yml ├── fork2repos.py ├── how-to-run-locally.sh ├── images-with-preinstalled-modules.sh ├── load-docker-layers.sh ├── oca_dependencies2configs.py ├── odoo-module-migrator-mix.yml └── save-docker-layers.sh /.github/workflows/DINAR2fork.yml: -------------------------------------------------------------------------------- 1 | name: "Check updates in DINAR" 2 | 3 | on: 4 | # Check for updates every Saturday morning 5 | #schedule: 6 | # - cron: "5 5 * * 6" 7 | # Check for updates when someone opened an issue 8 | # Can be used as a workaround to immediatly sync with DINAR 9 | issues: 10 | types: 11 | - opened 12 | - reopened 13 | 14 | jobs: 15 | DINAR2fork: 16 | runs-on: ubuntu-latest 17 | if: "github.repository != 'itpp-labs/DINAR'" 18 | steps: 19 | - name: Checkout Fork 20 | uses: actions/checkout@v2-beta 21 | with: 22 | fetch-depth: 100 23 | - name: Fetch DINAR 24 | run: | 25 | git remote add DINAR https://github.com/itpp-labs/DINAR.git 26 | git fetch DINAR 27 | - name: Merge DINAR 28 | run: | 29 | # Name must be specified to make merge commit 30 | git config --global user.email "itpp-bot@users.noreply.github.com" 31 | git config --global user.name "Mitchell Admin" 32 | git merge DINAR/master 33 | - name: Change DINAR's references to forked DINAR 34 | run: | 35 | find ./static-files/all/.github/workflows/ -iname "*.yml" | xargs sed -i "s;repository: itpp-labs/DINAR$;repository: $GITHUB_REPOSITORY;g" 36 | find ./static-files/all/.github/workflows/ -iname "*.yml" | xargs sed -i "s;DINAR_REPO=\"itpp-labs/DINAR\";DINAR_REPO=\"$GITHUB_REPOSITORY\";g" 37 | - name: Create Pull Request 38 | uses: peter-evans/create-pull-request@v3 39 | with: 40 | token: ${{ secrets.GITHUB_TOKEN }} 41 | branch: DINAR2fork 42 | title: DINAR2fork 43 | commit-message: Changes made by DINAR2fork.yml 44 | body: | 45 | > Made via .github/workflows/DINAR2fork.yml 46 | -------------------------------------------------------------------------------- /.github/workflows/fork2repos.yml: -------------------------------------------------------------------------------- 1 | name: "Push forked DINAR to Repos" 2 | 3 | on: 4 | push: 5 | paths: 6 | - ".github/workflows/fork2repos.yml" 7 | - "workflow-files/fork2repos.py" 8 | - "static-files/**" 9 | - "config.yml" 10 | branches: 11 | - master 12 | 13 | jobs: 14 | upload-files: 15 | runs-on: ubuntu-latest 16 | if: "github.repository != 'itpp-labs/DINAR'" 17 | steps: 18 | - name: Checkout Fork 19 | uses: actions/checkout@v4 20 | with: 21 | path: FORK 22 | - uses: actions/setup-python@v4 23 | with: 24 | python-version: "3.10" 25 | - name: Install python tools 26 | run: | 27 | pip install plumbum pyyaml 28 | - name: Sync DINAR files 29 | run: | 30 | python FORK/workflow-files/fork2repos.py FORK/config.yml "${{ secrets.BOT_TOKEN }}" "${{ secrets.BOT_NAME }}" "${{ secrets.BOT_EMAIL }}" 31 | -------------------------------------------------------------------------------- /.github/workflows/pre-commit.yml: -------------------------------------------------------------------------------- 1 | name: "pre-commit" 2 | 3 | on: 4 | pull_request: 5 | 6 | jobs: 7 | pre-commit: 8 | name: "pre-commit" 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout Repo 12 | uses: actions/checkout@v2 13 | - uses: actions/setup-python@v4 14 | with: 15 | python-version: "3.10" 16 | - name: Check Python Version 17 | run: echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV 18 | - uses: actions/cache@v4 19 | with: 20 | path: ~/.cache/pre-commit 21 | key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} 22 | - uses: pre-commit/action@v1.0.1 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | -------------------------------------------------------------------------------- /.isort.cfg: -------------------------------------------------------------------------------- 1 | [settings] 2 | ; see https://github.com/psf/black 3 | multi_line_output=3 4 | include_trailing_comma=True 5 | force_grid_wrap=0 6 | combine_as_imports=True 7 | use_parentheses=True 8 | line_length=88 9 | sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER 10 | known_third_party = branch2odoo_version,oca_dependencies2configs,plumbum,yaml 11 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | exclude: "^setup/|/static/lib/|/static/src/lib/" 2 | default_language_version: 3 | python: python3 4 | repos: 5 | - repo: https://github.com/myint/autoflake 6 | rev: v1.4 7 | hooks: 8 | - id: autoflake 9 | args: ["-i", "--ignore-init-module-imports"] 10 | - repo: https://github.com/psf/black 11 | rev: 22.3.0 12 | hooks: 13 | - id: black 14 | - repo: https://github.com/pre-commit/mirrors-prettier 15 | rev: v2.1.2 16 | hooks: 17 | - id: prettier 18 | name: prettier + plugin-xml 19 | additional_dependencies: 20 | - "prettier@2.1.2" 21 | - "@prettier/plugin-xml@0.12.0" 22 | args: 23 | - --plugin=@prettier/plugin-xml 24 | - repo: https://github.com/pre-commit/pre-commit-hooks 25 | rev: v2.4.0 26 | hooks: 27 | - id: trailing-whitespace 28 | # exclude autogenerated files 29 | exclude: /README\.rst$ 30 | - id: end-of-file-fixer 31 | # exclude autogenerated files 32 | exclude: /README\.rst$ 33 | - id: debug-statements 34 | - id: fix-encoding-pragma 35 | args: ["--remove"] 36 | - id: check-case-conflict 37 | - id: check-docstring-first 38 | - id: check-executables-have-shebangs 39 | - id: check-merge-conflict 40 | - id: check-symlinks 41 | - id: check-xml 42 | - id: mixed-line-ending 43 | args: ["--fix=lf"] 44 | - repo: https://github.com/asottile/pyupgrade 45 | rev: v1.26.2 46 | hooks: 47 | - id: pyupgrade 48 | - repo: https://github.com/PyCQA/isort 49 | rev: 5.12.0 50 | hooks: 51 | - id: isort 52 | name: isort except __init__.py 53 | args: 54 | - --settings=. 55 | exclude: /__init__\.py$ 56 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DINAR 2 | 3 | **D**INAR **I**s **N**ot **A** **R**unbot. 4 | 5 | DINAR helps you to configure Github Actions to maintain Odoo addons. 6 | 7 | - deploy common files (e.g. pre-comming config) 8 | - run checks in pull requests 9 | - preview pull requests 10 | - port modules to next Odoo version 11 | 12 | # Usage 13 | 14 | - Fork [DINAR](https://github.com/itpp-labs/DINAR/) 15 | - [Set secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets#creating-encrypted-secrets) 16 | 17 | - `BOT_TOKEN` -- [github token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) with push access to the repos 18 | - `BOT_NAME` -- Optional. Default `Github Actions` 19 | - `BOT_EMAIL` -- Optional. Default `actions@github.com` 20 | 21 | - Make `config.yml` file to list repositories and set other settings. See [`config.example.yml`](config.example.yml) for details. 22 | - Check Actions tab in the fork 23 | - In your repositories: set secrets: 24 | 25 | - `DINAR_TOKEN` -- with access `write:packages`, `read:packages` 26 | 27 | - In your repositories: send new PR or rebase existing one 28 | 29 | # Repository structure 30 | 31 | - `.github/workflows/`: 32 | 33 | - [`DINAR2fork.yml`](.github/workflows/DINAR2fork.yml) -- checks for updates in DINAR and makes PR to your fork 34 | - [`fork2repos.yml`](.github/workflows/fork2repos.yml) -- Github Workflow to install forked DINAR to your repositories 35 | 36 | - `static-files/` -- **copy** and **push** to a repo **with overwriting**. Mandatory files to make the system work. 37 | 38 | - `all/` -- files for any version 39 | - `10.0/`, `11.0/`, etc -- version specific files 40 | 41 | - `editable-files/` -- **copy** and **push** to a repo **without overwriting**. The files can be modified per repository. 42 | - `embedded-files/` -- **copy** to a repo **without overwriting**. The files used on generating Docker images and normally shall not be modified per repository. 43 | - `workflow-files/` -- scripts that can be used from workflows without coping. 44 | - `local-files/` -- files to download to maintainer's machine to work with the dockers locally 45 | 46 | # Docker images 47 | 48 | DINAR builds and push docker images to Github Packages. It works 49 | [only](https://github.com/itpp-labs/DINAR/issues/60) for stable branches (e.g. 50 | `12.0`) and branches marked with `-dev-` code (e.g. 51 | `12.0-dev-some-new-feature`). Examples of docker images for 12.0 branch of 52 | `repo-name` repository: 53 | 54 | - `dinar-odoo-repo-name:12.0-base` - base odoo image with dependencies: installs packages and fetches repositories. It uses settings from [`.DINAR/image/`](editable-files/.DINAR/image/dependencies/). 55 | - Odoo and postgres images with preinstalled modules specified in manifest's `depends` attribute plus modules listed in `addons.include` attribute of [`.DINAR/config.yaml`](editable-files/.DINAR/config.yaml). 56 | 57 | - `dinar-odoo-repo-name:12.0`, `dinar-db-repo-name:12.0` -- modules are installed with demo data 58 | - `dinar-odoo-repo-name:12.0-nodemo`, `dinar-db-repo-name:12.0-nodemo` -- modules are installed without demo data 59 | -------------------------------------------------------------------------------- /config.example.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | - "10.0" 3 | - "11.0" 4 | - "12.0" 5 | - "13.0" 6 | - "14.0" 7 | 8 | repos: 9 | itpp-labs/misc-addons: 10 | itpp-labs/pos-addons: 11 | itpp-labs/website-addons: 12 | itpp-labs/mail-addons: 13 | itpp-labs/access-addons: 14 | itpp-labs/sync-addons: 15 | -------------------------------------------------------------------------------- /editable-files/.DINAR/config.yaml: -------------------------------------------------------------------------------- 1 | addons: 2 | # modules to install before running tests 3 | include: 4 | - contacts 5 | 6 | # modules to exclude from installation/testing 7 | exclude: 8 | - hw_proxy 9 | 10 | server_wide_modules: 11 | - web 12 | -------------------------------------------------------------------------------- /editable-files/.DINAR/image/README.md: -------------------------------------------------------------------------------- 1 | This folder is attached on image building as `custom/` folder in 2 | [doobba](https://github.com/Tecnativa/doodba#image-usage). Few additional 3 | [files](https://github.com/itpp-labs/DINAR/tree/master/embedded-files/.DINAR/image) are 4 | attached temporary on image building. 5 | -------------------------------------------------------------------------------- /editable-files/.DINAR/image/dependencies/pip.txt: -------------------------------------------------------------------------------- 1 | # Python dependencies 2 | -------------------------------------------------------------------------------- /editable-files/.DINAR/image/src/addons.yaml: -------------------------------------------------------------------------------- 1 | # see https://github.com/Tecnativa/doodba#optodoocustomsrcaddonsyaml 2 | -------------------------------------------------------------------------------- /editable-files/.DINAR/image/src/repos.yaml: -------------------------------------------------------------------------------- 1 | # Documentation: https://github.com/Tecnativa/doodba#optodoocustomsrcreposyaml 2 | 3 | # Odoo source. 4 | # Update this section to switch to OCA/OCB or apply custom patches 5 | odoo: 6 | defaults: 7 | depth: 1 8 | remotes: 9 | origin: https://github.com/odoo/odoo.git 10 | target: origin $ODOO_VERSION 11 | merges: 12 | - origin $ODOO_VERSION 13 | -------------------------------------------------------------------------------- /editable-files/.isort.cfg: -------------------------------------------------------------------------------- 1 | [settings] 2 | ; see https://github.com/psf/black 3 | multi_line_output=3 4 | include_trailing_comma=True 5 | force_grid_wrap=0 6 | combine_as_imports=True 7 | use_parentheses=True 8 | line_length=88 9 | known_odoo=odoo 10 | known_odoo_addons=odoo.addons 11 | sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER 12 | default_section=THIRDPARTY 13 | known_third_party= 14 | -------------------------------------------------------------------------------- /embedded-files/.DINAR/.dockerignore: -------------------------------------------------------------------------------- 1 | image/src/* 2 | !image/src/private 3 | !image/src/*.* 4 | config.yaml 5 | -------------------------------------------------------------------------------- /embedded-files/.DINAR/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ODOO_VERSION 2 | FROM ghcr.io/itpp-labs/doodba:${ODOO_VERSION}-onbuild 3 | -------------------------------------------------------------------------------- /embedded-files/.DINAR/image/build.d/099-create-netrc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mv /opt/odoo/custom/.netrc ~/ 3 | chmod 600 ~/.netrc 4 | -------------------------------------------------------------------------------- /embedded-files/.DINAR/image/build.d/101-rm-netrc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rm ~/.netrc 3 | -------------------------------------------------------------------------------- /local-files/docker-compose.override.yml: -------------------------------------------------------------------------------- 1 | version: "2.4" 2 | 3 | services: 4 | odoo: 5 | ports: 6 | - "127.0.0.1:6899:6899" 7 | - "127.0.0.1:8069:8069" 8 | depends_on: 9 | - smtp 10 | - wdb 11 | command: > 12 | odoo 13 | --limit-memory-soft=0 14 | --limit-time-real-cron=9999999 15 | --limit-time-real=9999999 16 | --workers=0 17 | --init=$MODULES 18 | --load=$LOAD_MODULES 19 | $ODOO_EXTRA_ARG 20 | 21 | smtp: 22 | image: mailhog/mailhog 23 | ports: 24 | - "127.0.0.1:8025:8025" 25 | 26 | wdb: 27 | image: kozea/wdb 28 | ports: 29 | - "127.0.0.1:1984:1984" 30 | # HACK https://github.com/Kozea/wdb/issues/136 31 | stop_signal: KILL 32 | -------------------------------------------------------------------------------- /static-files/10.0/.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | exclude: | 2 | (?x) 3 | # Files and folders generated by bots, to avoid loops 4 | ^setup/|/static/description/index\.html$|/i18n/.*\.pot?$| 5 | # Maybe reactivate this when all README files include prettier ignore tags? 6 | ^README\.md$| 7 | # Library files can have extraneous formatting (even minimized) 8 | /static/(src/)?lib/| 9 | # Repos using Sphinx to generate docs don't need prettying 10 | ^docs/_templates/.*\.html$| 11 | # You don't usually want a bot to modify your legal texts 12 | (LICENSE.*|COPYING.*) 13 | default_language_version: 14 | python: python3 15 | repos: 16 | - repo: https://github.com/myint/autoflake 17 | rev: v1.4 18 | hooks: 19 | - id: autoflake 20 | args: ["-i", "--ignore-init-module-imports"] 21 | - repo: https://github.com/psf/black 22 | rev: 20.8b1 23 | hooks: 24 | - id: black 25 | additional_dependencies: ["click<8.1.0"] 26 | - repo: https://github.com/pre-commit/mirrors-prettier 27 | rev: v2.1.2 28 | hooks: 29 | - id: prettier 30 | name: prettier + plugin-xml 31 | additional_dependencies: 32 | - "prettier@2.1.2" 33 | - "@prettier/plugin-xml@0.12.0" 34 | args: 35 | - --plugin=@prettier/plugin-xml 36 | - repo: https://github.com/pre-commit/mirrors-eslint 37 | rev: v7.8.1 38 | hooks: 39 | - id: eslint 40 | verbose: true 41 | args: 42 | - --color 43 | - --fix 44 | - repo: https://github.com/pre-commit/pre-commit-hooks 45 | rev: v2.4.0 46 | hooks: 47 | - id: trailing-whitespace 48 | # exclude autogenerated files 49 | exclude: /README\.rst$ 50 | - id: end-of-file-fixer 51 | # exclude autogenerated files 52 | exclude: /README\.rst$ 53 | - id: debug-statements 54 | - id: fix-encoding-pragma 55 | args: ["--remove"] 56 | - id: check-case-conflict 57 | - id: check-docstring-first 58 | - id: check-executables-have-shebangs 59 | - id: check-merge-conflict 60 | - id: check-symlinks 61 | - id: check-xml 62 | - id: mixed-line-ending 63 | args: ["--fix=lf"] 64 | - repo: https://github.com/PyCQA/pylint 65 | rev: pylint-2.5.3 66 | hooks: 67 | - id: pylint 68 | name: pylint with optional checks 69 | args: ["--rcfile=.pylintrc", "--exit-zero"] 70 | verbose: true 71 | additional_dependencies: &pylint_deps 72 | - pylint-odoo==3.5.0 73 | - id: pylint 74 | name: pylint with mandatory checks 75 | args: ["--rcfile=.pylintrc-mandatory"] 76 | additional_dependencies: *pylint_deps 77 | - repo: https://github.com/asottile/pyupgrade 78 | rev: v1.26.2 79 | hooks: 80 | - id: pyupgrade 81 | - repo: https://github.com/pycqa/flake8 82 | rev: 3.8.3 83 | hooks: 84 | - id: flake8 85 | name: flake8 except __init__.py 86 | exclude: /__init__\.py$ 87 | additional_dependencies: ["flake8-bugbear==20.1.4"] 88 | - id: flake8 89 | name: flake8 only __init__.py 90 | args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py 91 | files: /__init__\.py$ 92 | additional_dependencies: ["flake8-bugbear==20.1.4"] 93 | - repo: https://github.com/PyCQA/isort 94 | rev: 5.5.1 95 | hooks: 96 | - id: isort 97 | name: isort except __init__.py 98 | args: 99 | - --settings=. 100 | exclude: /__init__\.py$ 101 | -------------------------------------------------------------------------------- /static-files/10.0/.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_odoo 3 | score=n 4 | 5 | [ODOOLINT] 6 | readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" 7 | manifest_required_authors=IT Projects Labs 8 | manifest_required_keys=license 9 | manifest_deprecated_keys=description,active 10 | license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 11 | valid_odoo_versions=10.0 12 | 13 | [MESSAGES CONTROL] 14 | disable=all 15 | 16 | # This .pylintrc contains optional AND mandatory checks and is meant to be 17 | # loaded in an IDE to have it check everything, in the hope this will make 18 | # optional checks more visible to contributors who otherwise never look at a 19 | # green travis to see optional checks that failed. 20 | # .pylintrc-mandatory containing only mandatory checks is used the pre-commit 21 | # config as a blocking check. 22 | 23 | enable=anomalous-backslash-in-string, 24 | #api-one-deprecated, 25 | api-one-multi-together, 26 | assignment-from-none, 27 | attribute-deprecated, 28 | class-camelcase, 29 | dangerous-default-value, 30 | dangerous-view-replace-wo-priority, 31 | duplicate-id-csv, 32 | duplicate-key, 33 | duplicate-xml-fields, 34 | duplicate-xml-record-id, 35 | eval-referenced, 36 | eval-used, 37 | incoherent-interpreter-exec-perm, 38 | license-allowed, 39 | manifest-author-string, 40 | manifest-deprecated-key, 41 | #manifest-required-author, 42 | manifest-required-key, 43 | manifest-version-format, 44 | method-compute, 45 | method-inverse, 46 | method-required-super, 47 | method-search, 48 | missing-import-error, 49 | missing-manifest-dependency, 50 | openerp-exception-warning, 51 | pointless-statement, 52 | pointless-string-statement, 53 | print-used, 54 | redundant-keyword-arg, 55 | redundant-modulename-xml, 56 | reimported, 57 | relative-import, 58 | return-in-init, 59 | rst-syntax-error, 60 | sql-injection, 61 | too-few-format-args, 62 | translation-field, 63 | translation-required, 64 | unreachable, 65 | use-vim-comment, 66 | wrong-tabs-instead-of-spaces, 67 | xml-syntax-error, 68 | # messages that do not cause the lint step to fail 69 | consider-merging-classes-inherited, 70 | create-user-wo-reset-password, 71 | dangerous-filter-wo-user, 72 | deprecated-module, 73 | file-not-used, 74 | invalid-commit, 75 | missing-newline-extrafiles, 76 | missing-readme, 77 | no-utf8-coding-comment, 78 | odoo-addons-relative-import, 79 | old-api7-method-defined, 80 | redefined-builtin, 81 | too-complex, 82 | unnecessary-utf8-coding-comment 83 | 84 | [REPORTS] 85 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 86 | output-format=colorized 87 | reports=no 88 | -------------------------------------------------------------------------------- /static-files/10.0/.pylintrc-mandatory: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_odoo 3 | score=n 4 | 5 | [ODOOLINT] 6 | readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" 7 | manifest_required_authors=IT Projects Labs 8 | manifest_required_keys=license 9 | manifest_deprecated_keys=description,active 10 | license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 11 | valid_odoo_versions=10.0 12 | 13 | [MESSAGES CONTROL] 14 | disable=all 15 | 16 | enable=anomalous-backslash-in-string, 17 | #api-one-deprecated, 18 | api-one-multi-together, 19 | assignment-from-none, 20 | attribute-deprecated, 21 | class-camelcase, 22 | dangerous-default-value, 23 | dangerous-view-replace-wo-priority, 24 | duplicate-id-csv, 25 | duplicate-key, 26 | duplicate-xml-fields, 27 | duplicate-xml-record-id, 28 | eval-referenced, 29 | eval-used, 30 | incoherent-interpreter-exec-perm, 31 | license-allowed, 32 | manifest-author-string, 33 | manifest-deprecated-key, 34 | #manifest-required-author, 35 | manifest-required-key, 36 | manifest-version-format, 37 | method-compute, 38 | method-inverse, 39 | method-required-super, 40 | method-search, 41 | missing-import-error, 42 | missing-manifest-dependency, 43 | openerp-exception-warning, 44 | pointless-statement, 45 | pointless-string-statement, 46 | print-used, 47 | redundant-keyword-arg, 48 | redundant-modulename-xml, 49 | reimported, 50 | relative-import, 51 | return-in-init, 52 | rst-syntax-error, 53 | sql-injection, 54 | too-few-format-args, 55 | translation-field, 56 | translation-required, 57 | unreachable, 58 | use-vim-comment, 59 | wrong-tabs-instead-of-spaces, 60 | xml-syntax-error 61 | 62 | [REPORTS] 63 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 64 | output-format=colorized 65 | reports=no 66 | -------------------------------------------------------------------------------- /static-files/11.0/.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | exclude: | 2 | (?x) 3 | # Files and folders generated by bots, to avoid loops 4 | ^setup/|/static/description/index\.html$|/i18n/.*\.pot?$| 5 | # Maybe reactivate this when all README files include prettier ignore tags? 6 | ^README\.md$| 7 | # Library files can have extraneous formatting (even minimized) 8 | /static/(src/)?lib/| 9 | # Repos using Sphinx to generate docs don't need prettying 10 | ^docs/_templates/.*\.html$| 11 | # You don't usually want a bot to modify your legal texts 12 | (LICENSE.*|COPYING.*) 13 | default_language_version: 14 | python: python3 15 | repos: 16 | - repo: https://github.com/myint/autoflake 17 | rev: v1.4 18 | hooks: 19 | - id: autoflake 20 | args: ["-i", "--ignore-init-module-imports"] 21 | - repo: https://github.com/psf/black 22 | rev: 20.8b1 23 | hooks: 24 | - id: black 25 | additional_dependencies: ["click<8.1.0"] 26 | - repo: https://github.com/pre-commit/mirrors-prettier 27 | rev: v2.1.2 28 | hooks: 29 | - id: prettier 30 | name: prettier + plugin-xml 31 | additional_dependencies: 32 | - "prettier@2.1.2" 33 | - "@prettier/plugin-xml@0.12.0" 34 | args: 35 | - --plugin=@prettier/plugin-xml 36 | - repo: https://github.com/pre-commit/mirrors-eslint 37 | rev: v7.8.1 38 | hooks: 39 | - id: eslint 40 | verbose: true 41 | args: 42 | - --color 43 | - --fix 44 | - repo: https://github.com/pre-commit/pre-commit-hooks 45 | rev: v2.4.0 46 | hooks: 47 | - id: trailing-whitespace 48 | # exclude autogenerated files 49 | exclude: /README\.rst$ 50 | - id: end-of-file-fixer 51 | # exclude autogenerated files 52 | exclude: /README\.rst$ 53 | - id: debug-statements 54 | - id: fix-encoding-pragma 55 | args: ["--remove"] 56 | - id: check-case-conflict 57 | - id: check-docstring-first 58 | - id: check-executables-have-shebangs 59 | - id: check-merge-conflict 60 | - id: check-symlinks 61 | - id: check-xml 62 | - id: mixed-line-ending 63 | args: ["--fix=lf"] 64 | - repo: https://github.com/PyCQA/pylint 65 | rev: pylint-2.5.3 66 | hooks: 67 | - id: pylint 68 | name: pylint with optional checks 69 | args: ["--rcfile=.pylintrc", "--exit-zero"] 70 | verbose: true 71 | additional_dependencies: &pylint_deps 72 | - pylint-odoo==3.5.0 73 | - id: pylint 74 | name: pylint with mandatory checks 75 | args: ["--rcfile=.pylintrc-mandatory"] 76 | additional_dependencies: *pylint_deps 77 | - repo: https://github.com/asottile/pyupgrade 78 | rev: v1.26.2 79 | hooks: 80 | - id: pyupgrade 81 | - repo: https://github.com/pycqa/flake8 82 | rev: 3.8.3 83 | hooks: 84 | - id: flake8 85 | name: flake8 except __init__.py 86 | exclude: /__init__\.py$ 87 | additional_dependencies: ["flake8-bugbear==20.1.4"] 88 | - id: flake8 89 | name: flake8 only __init__.py 90 | args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py 91 | files: /__init__\.py$ 92 | additional_dependencies: ["flake8-bugbear==20.1.4"] 93 | - repo: https://github.com/PyCQA/isort 94 | rev: 5.5.1 95 | hooks: 96 | - id: isort 97 | name: isort except __init__.py 98 | args: 99 | - --settings=. 100 | exclude: /__init__\.py$ 101 | -------------------------------------------------------------------------------- /static-files/11.0/.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_odoo 3 | score=n 4 | 5 | [ODOOLINT] 6 | readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" 7 | manifest_required_authors=IT Projects Labs 8 | manifest_required_keys=license 9 | manifest_deprecated_keys=description,active 10 | license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 11 | valid_odoo_versions=11.0 12 | 13 | [MESSAGES CONTROL] 14 | disable=all 15 | 16 | # This .pylintrc contains optional AND mandatory checks and is meant to be 17 | # loaded in an IDE to have it check everything, in the hope this will make 18 | # optional checks more visible to contributors who otherwise never look at a 19 | # green travis to see optional checks that failed. 20 | # .pylintrc-mandatory containing only mandatory checks is used the pre-commit 21 | # config as a blocking check. 22 | 23 | enable=anomalous-backslash-in-string, 24 | #api-one-deprecated, 25 | api-one-multi-together, 26 | assignment-from-none, 27 | attribute-deprecated, 28 | class-camelcase, 29 | dangerous-default-value, 30 | dangerous-view-replace-wo-priority, 31 | duplicate-id-csv, 32 | duplicate-key, 33 | duplicate-xml-fields, 34 | duplicate-xml-record-id, 35 | eval-referenced, 36 | eval-used, 37 | incoherent-interpreter-exec-perm, 38 | license-allowed, 39 | manifest-author-string, 40 | manifest-deprecated-key, 41 | #manifest-required-author, 42 | manifest-required-key, 43 | manifest-version-format, 44 | method-compute, 45 | method-inverse, 46 | method-required-super, 47 | method-search, 48 | missing-import-error, 49 | missing-manifest-dependency, 50 | openerp-exception-warning, 51 | pointless-statement, 52 | pointless-string-statement, 53 | print-used, 54 | redundant-keyword-arg, 55 | redundant-modulename-xml, 56 | reimported, 57 | relative-import, 58 | return-in-init, 59 | rst-syntax-error, 60 | sql-injection, 61 | too-few-format-args, 62 | translation-field, 63 | translation-required, 64 | unreachable, 65 | use-vim-comment, 66 | wrong-tabs-instead-of-spaces, 67 | xml-syntax-error, 68 | # messages that do not cause the lint step to fail 69 | consider-merging-classes-inherited, 70 | create-user-wo-reset-password, 71 | dangerous-filter-wo-user, 72 | deprecated-module, 73 | file-not-used, 74 | invalid-commit, 75 | missing-newline-extrafiles, 76 | missing-readme, 77 | no-utf8-coding-comment, 78 | odoo-addons-relative-import, 79 | old-api7-method-defined, 80 | redefined-builtin, 81 | too-complex, 82 | unnecessary-utf8-coding-comment 83 | 84 | [REPORTS] 85 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 86 | output-format=colorized 87 | reports=no 88 | -------------------------------------------------------------------------------- /static-files/11.0/.pylintrc-mandatory: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_odoo 3 | score=n 4 | 5 | [ODOOLINT] 6 | readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" 7 | manifest_required_authors=IT Projects Labs 8 | manifest_required_keys=license 9 | manifest_deprecated_keys=description,active 10 | license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 11 | valid_odoo_versions=11.0 12 | 13 | [MESSAGES CONTROL] 14 | disable=all 15 | 16 | enable=anomalous-backslash-in-string, 17 | #api-one-deprecated, 18 | api-one-multi-together, 19 | assignment-from-none, 20 | attribute-deprecated, 21 | class-camelcase, 22 | dangerous-default-value, 23 | dangerous-view-replace-wo-priority, 24 | duplicate-id-csv, 25 | duplicate-key, 26 | duplicate-xml-fields, 27 | duplicate-xml-record-id, 28 | eval-referenced, 29 | eval-used, 30 | incoherent-interpreter-exec-perm, 31 | license-allowed, 32 | manifest-author-string, 33 | manifest-deprecated-key, 34 | #manifest-required-author, 35 | manifest-required-key, 36 | manifest-version-format, 37 | method-compute, 38 | method-inverse, 39 | method-required-super, 40 | method-search, 41 | missing-import-error, 42 | missing-manifest-dependency, 43 | openerp-exception-warning, 44 | pointless-statement, 45 | pointless-string-statement, 46 | print-used, 47 | redundant-keyword-arg, 48 | redundant-modulename-xml, 49 | reimported, 50 | relative-import, 51 | return-in-init, 52 | rst-syntax-error, 53 | sql-injection, 54 | too-few-format-args, 55 | translation-field, 56 | translation-required, 57 | unreachable, 58 | use-vim-comment, 59 | wrong-tabs-instead-of-spaces, 60 | xml-syntax-error 61 | 62 | [REPORTS] 63 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 64 | output-format=colorized 65 | reports=no 66 | -------------------------------------------------------------------------------- /static-files/12.0/.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | exclude: | 2 | (?x) 3 | # Files and folders generated by bots, to avoid loops 4 | ^setup/|/static/description/index\.html$|/i18n/.*\.pot?$| 5 | # Maybe reactivate this when all README files include prettier ignore tags? 6 | ^README\.md$| 7 | # Library files can have extraneous formatting (even minimized) 8 | /static/(src/)?lib/| 9 | # Repos using Sphinx to generate docs don't need prettying 10 | ^docs/_templates/.*\.html$| 11 | # You don't usually want a bot to modify your legal texts 12 | (LICENSE.*|COPYING.*) 13 | default_language_version: 14 | python: python3 15 | repos: 16 | - repo: https://github.com/myint/autoflake 17 | rev: v1.4 18 | hooks: 19 | - id: autoflake 20 | args: ["-i", "--ignore-init-module-imports"] 21 | - repo: https://github.com/psf/black 22 | rev: 20.8b1 23 | hooks: 24 | - id: black 25 | additional_dependencies: ["click<8.1.0"] 26 | - repo: https://github.com/pre-commit/mirrors-prettier 27 | rev: v2.1.2 28 | hooks: 29 | - id: prettier 30 | name: prettier + plugin-xml 31 | additional_dependencies: 32 | - "prettier@2.1.2" 33 | - "@prettier/plugin-xml@0.12.0" 34 | args: 35 | - --plugin=@prettier/plugin-xml 36 | - repo: https://github.com/pre-commit/mirrors-eslint 37 | rev: v7.8.1 38 | hooks: 39 | - id: eslint 40 | verbose: true 41 | args: 42 | - --color 43 | - --fix 44 | - repo: https://github.com/pre-commit/pre-commit-hooks 45 | rev: v2.4.0 46 | hooks: 47 | - id: trailing-whitespace 48 | # exclude autogenerated files 49 | exclude: /README\.rst$ 50 | - id: end-of-file-fixer 51 | # exclude autogenerated files 52 | exclude: /README\.rst$ 53 | - id: debug-statements 54 | - id: fix-encoding-pragma 55 | args: ["--remove"] 56 | - id: check-case-conflict 57 | - id: check-docstring-first 58 | - id: check-executables-have-shebangs 59 | - id: check-merge-conflict 60 | - id: check-symlinks 61 | - id: check-xml 62 | - id: mixed-line-ending 63 | args: ["--fix=lf"] 64 | - repo: https://github.com/PyCQA/pylint 65 | rev: pylint-2.5.3 66 | hooks: 67 | - id: pylint 68 | name: pylint with optional checks 69 | args: ["--rcfile=.pylintrc", "--exit-zero"] 70 | verbose: true 71 | additional_dependencies: &pylint_deps 72 | - pylint-odoo==3.5.0 73 | - id: pylint 74 | name: pylint with mandatory checks 75 | args: ["--rcfile=.pylintrc-mandatory"] 76 | additional_dependencies: *pylint_deps 77 | - repo: https://github.com/asottile/pyupgrade 78 | rev: v1.26.2 79 | hooks: 80 | - id: pyupgrade 81 | - repo: https://github.com/pycqa/flake8 82 | rev: 3.8.3 83 | hooks: 84 | - id: flake8 85 | name: flake8 except __init__.py 86 | exclude: /__init__\.py$ 87 | additional_dependencies: ["flake8-bugbear==20.1.4"] 88 | - id: flake8 89 | name: flake8 only __init__.py 90 | args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py 91 | files: /__init__\.py$ 92 | additional_dependencies: ["flake8-bugbear==20.1.4"] 93 | - repo: https://github.com/PyCQA/isort 94 | rev: 5.5.1 95 | hooks: 96 | - id: isort 97 | name: isort except __init__.py 98 | args: 99 | - --settings=. 100 | exclude: /__init__\.py$ 101 | -------------------------------------------------------------------------------- /static-files/12.0/.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_odoo 3 | score=n 4 | 5 | [ODOOLINT] 6 | readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" 7 | manifest_required_authors=IT Projects Labs 8 | manifest_required_keys=license 9 | manifest_deprecated_keys=description,active 10 | license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 11 | valid_odoo_versions=12.0 12 | 13 | [MESSAGES CONTROL] 14 | disable=all 15 | 16 | # This .pylintrc contains optional AND mandatory checks and is meant to be 17 | # loaded in an IDE to have it check everything, in the hope this will make 18 | # optional checks more visible to contributors who otherwise never look at a 19 | # green travis to see optional checks that failed. 20 | # .pylintrc-mandatory containing only mandatory checks is used the pre-commit 21 | # config as a blocking check. 22 | 23 | enable=anomalous-backslash-in-string, 24 | #api-one-deprecated, 25 | api-one-multi-together, 26 | assignment-from-none, 27 | attribute-deprecated, 28 | class-camelcase, 29 | dangerous-default-value, 30 | dangerous-view-replace-wo-priority, 31 | duplicate-id-csv, 32 | duplicate-key, 33 | duplicate-xml-fields, 34 | duplicate-xml-record-id, 35 | eval-referenced, 36 | eval-used, 37 | incoherent-interpreter-exec-perm, 38 | license-allowed, 39 | manifest-author-string, 40 | manifest-deprecated-key, 41 | #manifest-required-author, 42 | manifest-required-key, 43 | manifest-version-format, 44 | method-compute, 45 | method-inverse, 46 | method-required-super, 47 | method-search, 48 | missing-import-error, 49 | missing-manifest-dependency, 50 | openerp-exception-warning, 51 | pointless-statement, 52 | pointless-string-statement, 53 | print-used, 54 | redundant-keyword-arg, 55 | redundant-modulename-xml, 56 | reimported, 57 | relative-import, 58 | return-in-init, 59 | rst-syntax-error, 60 | sql-injection, 61 | too-few-format-args, 62 | translation-field, 63 | translation-required, 64 | unreachable, 65 | use-vim-comment, 66 | wrong-tabs-instead-of-spaces, 67 | xml-syntax-error, 68 | # messages that do not cause the lint step to fail 69 | consider-merging-classes-inherited, 70 | create-user-wo-reset-password, 71 | dangerous-filter-wo-user, 72 | deprecated-module, 73 | file-not-used, 74 | invalid-commit, 75 | missing-newline-extrafiles, 76 | missing-readme, 77 | no-utf8-coding-comment, 78 | odoo-addons-relative-import, 79 | old-api7-method-defined, 80 | redefined-builtin, 81 | too-complex, 82 | unnecessary-utf8-coding-comment 83 | 84 | [REPORTS] 85 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 86 | output-format=colorized 87 | reports=no 88 | -------------------------------------------------------------------------------- /static-files/12.0/.pylintrc-mandatory: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_odoo 3 | score=n 4 | 5 | [ODOOLINT] 6 | readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" 7 | manifest_required_authors=IT Projects Labs 8 | manifest_required_keys=license 9 | manifest_deprecated_keys=description,active 10 | license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 11 | valid_odoo_versions=12.0 12 | 13 | [MESSAGES CONTROL] 14 | disable=all 15 | 16 | enable=anomalous-backslash-in-string, 17 | #api-one-deprecated, 18 | api-one-multi-together, 19 | assignment-from-none, 20 | attribute-deprecated, 21 | class-camelcase, 22 | dangerous-default-value, 23 | dangerous-view-replace-wo-priority, 24 | duplicate-id-csv, 25 | duplicate-key, 26 | duplicate-xml-fields, 27 | duplicate-xml-record-id, 28 | eval-referenced, 29 | eval-used, 30 | incoherent-interpreter-exec-perm, 31 | license-allowed, 32 | manifest-author-string, 33 | manifest-deprecated-key, 34 | #manifest-required-author, 35 | manifest-required-key, 36 | manifest-version-format, 37 | method-compute, 38 | method-inverse, 39 | method-required-super, 40 | method-search, 41 | missing-import-error, 42 | missing-manifest-dependency, 43 | openerp-exception-warning, 44 | pointless-statement, 45 | pointless-string-statement, 46 | print-used, 47 | redundant-keyword-arg, 48 | redundant-modulename-xml, 49 | reimported, 50 | relative-import, 51 | return-in-init, 52 | rst-syntax-error, 53 | sql-injection, 54 | too-few-format-args, 55 | translation-field, 56 | translation-required, 57 | unreachable, 58 | use-vim-comment, 59 | wrong-tabs-instead-of-spaces, 60 | xml-syntax-error 61 | 62 | [REPORTS] 63 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 64 | output-format=colorized 65 | reports=no 66 | -------------------------------------------------------------------------------- /static-files/13.0/.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | exclude: | 2 | (?x) 3 | # Files and folders generated by bots, to avoid loops 4 | ^setup/|/static/description/index\.html$|/i18n/.*\.pot?$| 5 | # Maybe reactivate this when all README files include prettier ignore tags? 6 | ^README\.md$| 7 | # Library files can have extraneous formatting (even minimized) 8 | /static/(src/)?lib/| 9 | # Repos using Sphinx to generate docs don't need prettying 10 | ^docs/_templates/.*\.html$| 11 | # You don't usually want a bot to modify your legal texts 12 | (LICENSE.*|COPYING.*) 13 | default_language_version: 14 | python: python3 15 | repos: 16 | - repo: https://github.com/myint/autoflake 17 | rev: v1.4 18 | hooks: 19 | - id: autoflake 20 | args: ["-i", "--ignore-init-module-imports"] 21 | - repo: https://github.com/psf/black 22 | rev: 20.8b1 23 | hooks: 24 | - id: black 25 | additional_dependencies: ["click<8.1.0"] 26 | - repo: https://github.com/pre-commit/mirrors-prettier 27 | rev: v2.1.2 28 | hooks: 29 | - id: prettier 30 | name: prettier + plugin-xml 31 | additional_dependencies: 32 | - "prettier@2.1.2" 33 | - "@prettier/plugin-xml@0.12.0" 34 | args: 35 | - --plugin=@prettier/plugin-xml 36 | - repo: https://github.com/pre-commit/mirrors-eslint 37 | rev: v7.8.1 38 | hooks: 39 | - id: eslint 40 | verbose: true 41 | args: 42 | - --color 43 | - --fix 44 | - repo: https://github.com/pre-commit/pre-commit-hooks 45 | rev: v2.4.0 46 | hooks: 47 | - id: trailing-whitespace 48 | # exclude autogenerated files 49 | exclude: /README\.rst$ 50 | - id: end-of-file-fixer 51 | # exclude autogenerated files 52 | exclude: /README\.rst$ 53 | - id: debug-statements 54 | - id: fix-encoding-pragma 55 | args: ["--remove"] 56 | - id: check-case-conflict 57 | - id: check-docstring-first 58 | - id: check-executables-have-shebangs 59 | - id: check-merge-conflict 60 | - id: check-symlinks 61 | - id: check-xml 62 | - id: mixed-line-ending 63 | args: ["--fix=lf"] 64 | - repo: https://github.com/PyCQA/pylint 65 | rev: pylint-2.5.3 66 | hooks: 67 | - id: pylint 68 | name: pylint with optional checks 69 | args: ["--rcfile=.pylintrc", "--exit-zero"] 70 | verbose: true 71 | additional_dependencies: &pylint_deps 72 | - pylint-odoo==3.5.0 73 | - id: pylint 74 | name: pylint with mandatory checks 75 | args: ["--rcfile=.pylintrc-mandatory"] 76 | additional_dependencies: *pylint_deps 77 | - repo: https://github.com/asottile/pyupgrade 78 | rev: v1.26.2 79 | hooks: 80 | - id: pyupgrade 81 | - repo: https://github.com/pycqa/flake8 82 | rev: 3.8.3 83 | hooks: 84 | - id: flake8 85 | name: flake8 except __init__.py 86 | exclude: /__init__\.py$ 87 | additional_dependencies: ["flake8-bugbear==20.1.4"] 88 | - id: flake8 89 | name: flake8 only __init__.py 90 | args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py 91 | files: /__init__\.py$ 92 | additional_dependencies: ["flake8-bugbear==20.1.4"] 93 | - repo: https://github.com/PyCQA/isort 94 | rev: 5.5.1 95 | hooks: 96 | - id: isort 97 | name: isort except __init__.py 98 | args: 99 | - --settings=. 100 | exclude: /__init__\.py$ 101 | -------------------------------------------------------------------------------- /static-files/13.0/.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_odoo 3 | score=n 4 | 5 | [ODOOLINT] 6 | readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" 7 | manifest_required_authors=IT Projects Labs 8 | manifest_required_keys=license 9 | manifest_deprecated_keys=description,active 10 | license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 11 | valid_odoo_versions=13.0 12 | 13 | [MESSAGES CONTROL] 14 | disable=all 15 | 16 | # This .pylintrc contains optional AND mandatory checks and is meant to be 17 | # loaded in an IDE to have it check everything, in the hope this will make 18 | # optional checks more visible to contributors who otherwise never look at a 19 | # green travis to see optional checks that failed. 20 | # .pylintrc-mandatory containing only mandatory checks is used the pre-commit 21 | # config as a blocking check. 22 | 23 | enable=anomalous-backslash-in-string, 24 | api-one-deprecated, 25 | api-one-multi-together, 26 | assignment-from-none, 27 | attribute-deprecated, 28 | class-camelcase, 29 | dangerous-default-value, 30 | dangerous-view-replace-wo-priority, 31 | duplicate-id-csv, 32 | duplicate-key, 33 | duplicate-xml-fields, 34 | duplicate-xml-record-id, 35 | eval-referenced, 36 | eval-used, 37 | incoherent-interpreter-exec-perm, 38 | license-allowed, 39 | manifest-author-string, 40 | manifest-deprecated-key, 41 | #manifest-required-author, 42 | manifest-required-key, 43 | manifest-version-format, 44 | method-compute, 45 | method-inverse, 46 | method-required-super, 47 | method-search, 48 | missing-import-error, 49 | missing-manifest-dependency, 50 | openerp-exception-warning, 51 | pointless-statement, 52 | pointless-string-statement, 53 | print-used, 54 | redundant-keyword-arg, 55 | redundant-modulename-xml, 56 | reimported, 57 | relative-import, 58 | return-in-init, 59 | rst-syntax-error, 60 | sql-injection, 61 | too-few-format-args, 62 | translation-field, 63 | translation-required, 64 | unreachable, 65 | use-vim-comment, 66 | wrong-tabs-instead-of-spaces, 67 | xml-syntax-error, 68 | # messages that do not cause the lint step to fail 69 | consider-merging-classes-inherited, 70 | create-user-wo-reset-password, 71 | dangerous-filter-wo-user, 72 | deprecated-module, 73 | file-not-used, 74 | invalid-commit, 75 | missing-newline-extrafiles, 76 | missing-readme, 77 | no-utf8-coding-comment, 78 | odoo-addons-relative-import, 79 | old-api7-method-defined, 80 | redefined-builtin, 81 | too-complex, 82 | unnecessary-utf8-coding-comment 83 | 84 | [REPORTS] 85 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 86 | output-format=colorized 87 | reports=no 88 | -------------------------------------------------------------------------------- /static-files/13.0/.pylintrc-mandatory: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_odoo 3 | score=n 4 | 5 | [ODOOLINT] 6 | readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" 7 | manifest_required_authors=IT Projects Labs 8 | manifest_required_keys=license 9 | manifest_deprecated_keys=description,active 10 | license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 11 | valid_odoo_versions=13.0 12 | 13 | [MESSAGES CONTROL] 14 | disable=all 15 | 16 | enable=anomalous-backslash-in-string, 17 | api-one-deprecated, 18 | api-one-multi-together, 19 | assignment-from-none, 20 | attribute-deprecated, 21 | class-camelcase, 22 | dangerous-default-value, 23 | dangerous-view-replace-wo-priority, 24 | duplicate-id-csv, 25 | duplicate-key, 26 | duplicate-xml-fields, 27 | duplicate-xml-record-id, 28 | eval-referenced, 29 | eval-used, 30 | incoherent-interpreter-exec-perm, 31 | license-allowed, 32 | manifest-author-string, 33 | manifest-deprecated-key, 34 | #manifest-required-author, 35 | manifest-required-key, 36 | manifest-version-format, 37 | method-compute, 38 | method-inverse, 39 | method-required-super, 40 | method-search, 41 | missing-import-error, 42 | missing-manifest-dependency, 43 | openerp-exception-warning, 44 | pointless-statement, 45 | pointless-string-statement, 46 | print-used, 47 | redundant-keyword-arg, 48 | redundant-modulename-xml, 49 | reimported, 50 | relative-import, 51 | return-in-init, 52 | rst-syntax-error, 53 | sql-injection, 54 | too-few-format-args, 55 | translation-field, 56 | translation-required, 57 | unreachable, 58 | use-vim-comment, 59 | wrong-tabs-instead-of-spaces, 60 | xml-syntax-error 61 | 62 | [REPORTS] 63 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 64 | output-format=colorized 65 | reports=no 66 | -------------------------------------------------------------------------------- /static-files/14.0/.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | exclude: | 2 | (?x) 3 | # Files and folders generated by bots, to avoid loops 4 | ^setup/|/static/description/index\.html$|/i18n/.*\.pot?$| 5 | # Maybe reactivate this when all README files include prettier ignore tags? 6 | ^README\.md$| 7 | # Library files can have extraneous formatting (even minimized) 8 | /static/(src/)?lib/| 9 | # Repos using Sphinx to generate docs don't need prettying 10 | ^docs/_templates/.*\.html$| 11 | # You don't usually want a bot to modify your legal texts 12 | (LICENSE.*|COPYING.*) 13 | default_language_version: 14 | python: python3 15 | node: "14.13.0" 16 | repos: 17 | - repo: https://github.com/myint/autoflake 18 | rev: v1.6.1 19 | hooks: 20 | - id: autoflake 21 | args: ["-i", "--ignore-init-module-imports"] 22 | - repo: https://github.com/psf/black 23 | rev: 22.3.0 24 | hooks: 25 | - id: black 26 | - repo: https://github.com/pre-commit/mirrors-prettier 27 | rev: v2.1.2 28 | hooks: 29 | - id: prettier 30 | name: prettier + plugin-xml 31 | additional_dependencies: 32 | - "prettier@2.1.2" 33 | - "@prettier/plugin-xml@0.12.0" 34 | args: 35 | - --plugin=@prettier/plugin-xml 36 | - repo: https://github.com/pre-commit/mirrors-eslint 37 | rev: v7.8.1 38 | hooks: 39 | - id: eslint 40 | verbose: true 41 | args: 42 | - --color 43 | - --fix 44 | - repo: https://github.com/pre-commit/pre-commit-hooks 45 | rev: v2.4.0 46 | hooks: 47 | - id: trailing-whitespace 48 | # exclude autogenerated files 49 | exclude: /README\.rst$ 50 | - id: end-of-file-fixer 51 | # exclude autogenerated files 52 | exclude: /README\.rst$ 53 | - id: debug-statements 54 | - id: fix-encoding-pragma 55 | args: ["--remove"] 56 | - id: check-case-conflict 57 | - id: check-docstring-first 58 | - id: check-executables-have-shebangs 59 | - id: check-merge-conflict 60 | - id: check-symlinks 61 | - id: check-xml 62 | - id: mixed-line-ending 63 | args: ["--fix=lf"] 64 | - repo: https://github.com/PyCQA/pylint 65 | rev: pylint-2.5.3 66 | hooks: 67 | - id: pylint 68 | name: pylint with optional checks 69 | args: ["--rcfile=.pylintrc", "--exit-zero"] 70 | verbose: true 71 | additional_dependencies: &pylint_deps 72 | - pylint-odoo==3.5.0 73 | - id: pylint 74 | name: pylint with mandatory checks 75 | args: ["--rcfile=.pylintrc-mandatory"] 76 | additional_dependencies: *pylint_deps 77 | - repo: https://github.com/asottile/pyupgrade 78 | rev: v1.26.2 79 | hooks: 80 | - id: pyupgrade 81 | args: ["--keep-percent-format"] 82 | - repo: https://github.com/acsone/setuptools-odoo 83 | rev: 2.6.0 84 | hooks: 85 | - id: setuptools-odoo-make-default 86 | - id: setuptools-odoo-get-requirements 87 | args: 88 | - --output 89 | - requirements.txt 90 | - --header 91 | - "# generated from manifests external_dependencies" 92 | - repo: https://github.com/pycqa/flake8 93 | rev: 3.8.3 94 | hooks: 95 | - id: flake8 96 | name: flake8 except __init__.py 97 | exclude: /__init__\.py$ 98 | additional_dependencies: ["flake8-bugbear==20.1.4"] 99 | - id: flake8 100 | name: flake8 only __init__.py 101 | args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py 102 | files: /__init__\.py$ 103 | additional_dependencies: ["flake8-bugbear==20.1.4"] 104 | - repo: https://github.com/PyCQA/isort 105 | rev: 5.12.0 106 | hooks: 107 | - id: isort 108 | name: isort except __init__.py 109 | args: 110 | - --settings=. 111 | exclude: /__init__\.py$ 112 | -------------------------------------------------------------------------------- /static-files/14.0/.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_odoo 3 | score=n 4 | 5 | [ODOOLINT] 6 | readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" 7 | manifest_required_authors=IT Projects Labs 8 | manifest_required_keys=license 9 | manifest_deprecated_keys=description,active 10 | license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 11 | valid_odoo_versions=14.0 12 | 13 | [MESSAGES CONTROL] 14 | disable=all 15 | 16 | # This .pylintrc contains optional AND mandatory checks and is meant to be 17 | # loaded in an IDE to have it check everything, in the hope this will make 18 | # optional checks more visible to contributors who otherwise never look at a 19 | # green travis to see optional checks that failed. 20 | # .pylintrc-mandatory containing only mandatory checks is used the pre-commit 21 | # config as a blocking check. 22 | 23 | enable=anomalous-backslash-in-string, 24 | api-one-deprecated, 25 | api-one-multi-together, 26 | assignment-from-none, 27 | attribute-deprecated, 28 | class-camelcase, 29 | dangerous-default-value, 30 | dangerous-view-replace-wo-priority, 31 | duplicate-id-csv, 32 | duplicate-key, 33 | duplicate-xml-fields, 34 | duplicate-xml-record-id, 35 | eval-referenced, 36 | eval-used, 37 | incoherent-interpreter-exec-perm, 38 | license-allowed, 39 | manifest-author-string, 40 | manifest-deprecated-key, 41 | #manifest-required-author, 42 | manifest-required-key, 43 | manifest-version-format, 44 | method-compute, 45 | method-inverse, 46 | method-required-super, 47 | method-search, 48 | missing-manifest-dependency, 49 | openerp-exception-warning, 50 | pointless-statement, 51 | pointless-string-statement, 52 | print-used, 53 | redundant-keyword-arg, 54 | redundant-modulename-xml, 55 | reimported, 56 | relative-import, 57 | return-in-init, 58 | rst-syntax-error, 59 | sql-injection, 60 | too-few-format-args, 61 | translation-field, 62 | translation-required, 63 | unreachable, 64 | use-vim-comment, 65 | wrong-tabs-instead-of-spaces, 66 | xml-syntax-error, 67 | # messages that do not cause the lint step to fail 68 | consider-merging-classes-inherited, 69 | create-user-wo-reset-password, 70 | dangerous-filter-wo-user, 71 | deprecated-module, 72 | file-not-used, 73 | invalid-commit, 74 | missing-newline-extrafiles, 75 | missing-readme, 76 | no-utf8-coding-comment, 77 | odoo-addons-relative-import, 78 | old-api7-method-defined, 79 | redefined-builtin, 80 | too-complex, 81 | unnecessary-utf8-coding-comment 82 | 83 | [REPORTS] 84 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 85 | output-format=colorized 86 | reports=no 87 | -------------------------------------------------------------------------------- /static-files/14.0/.pylintrc-mandatory: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_odoo 3 | score=n 4 | 5 | [ODOOLINT] 6 | readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" 7 | manifest_required_authors=IT Projects Labs 8 | manifest_required_keys=license 9 | manifest_deprecated_keys=description,active 10 | license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 11 | valid_odoo_versions=14.0 12 | 13 | [MESSAGES CONTROL] 14 | disable=all 15 | 16 | enable=anomalous-backslash-in-string, 17 | api-one-deprecated, 18 | api-one-multi-together, 19 | assignment-from-none, 20 | attribute-deprecated, 21 | class-camelcase, 22 | dangerous-default-value, 23 | dangerous-view-replace-wo-priority, 24 | duplicate-id-csv, 25 | duplicate-key, 26 | duplicate-xml-fields, 27 | duplicate-xml-record-id, 28 | eval-referenced, 29 | eval-used, 30 | incoherent-interpreter-exec-perm, 31 | license-allowed, 32 | manifest-author-string, 33 | manifest-deprecated-key, 34 | #manifest-required-author, 35 | manifest-required-key, 36 | manifest-version-format, 37 | method-compute, 38 | method-inverse, 39 | method-required-super, 40 | method-search, 41 | missing-import-error, 42 | missing-manifest-dependency, 43 | openerp-exception-warning, 44 | pointless-statement, 45 | pointless-string-statement, 46 | print-used, 47 | redundant-keyword-arg, 48 | redundant-modulename-xml, 49 | reimported, 50 | relative-import, 51 | return-in-init, 52 | rst-syntax-error, 53 | sql-injection, 54 | too-few-format-args, 55 | translation-field, 56 | translation-required, 57 | unreachable, 58 | use-vim-comment, 59 | wrong-tabs-instead-of-spaces, 60 | xml-syntax-error 61 | 62 | [REPORTS] 63 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 64 | output-format=colorized 65 | reports=no 66 | -------------------------------------------------------------------------------- /static-files/15.0/.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | exclude: | 2 | (?x) 3 | # Files and folders generated by bots, to avoid loops 4 | ^setup/|/static/description/index\.html$|/i18n/.*\.pot?$| 5 | # Maybe reactivate this when all README files include prettier ignore tags? 6 | ^README\.md$| 7 | # Library files can have extraneous formatting (even minimized) 8 | /static/(src/)?lib/| 9 | # Repos using Sphinx to generate docs don't need prettying 10 | ^docs/_templates/.*\.html$| 11 | # You don't usually want a bot to modify your legal texts 12 | (LICENSE.*|COPYING.*) 13 | default_language_version: 14 | python: python3 15 | node: "14.13.0" 16 | repos: 17 | - repo: https://github.com/myint/autoflake 18 | rev: v1.6.1 19 | hooks: 20 | - id: autoflake 21 | args: ["-i", "--ignore-init-module-imports"] 22 | - repo: https://github.com/psf/black 23 | rev: 22.3.0 24 | hooks: 25 | - id: black 26 | - repo: https://github.com/pre-commit/mirrors-prettier 27 | rev: v2.4.1 28 | hooks: 29 | - id: prettier 30 | name: prettier + plugin-xml 31 | additional_dependencies: 32 | - "prettier@2.1.2" 33 | - "@prettier/plugin-xml@0.12.0" 34 | args: 35 | - --plugin=@prettier/plugin-xml 36 | - repo: https://github.com/pre-commit/mirrors-eslint 37 | rev: v7.32.0 38 | hooks: 39 | - id: eslint 40 | verbose: true 41 | args: 42 | - --color 43 | - --fix 44 | - repo: https://github.com/pre-commit/pre-commit-hooks 45 | rev: v4.0.1 46 | hooks: 47 | - id: trailing-whitespace 48 | # exclude autogenerated files 49 | exclude: /README\.rst$ 50 | - id: end-of-file-fixer 51 | # exclude autogenerated files 52 | exclude: /README\.rst$ 53 | - id: debug-statements 54 | - id: fix-encoding-pragma 55 | args: ["--remove"] 56 | - id: check-case-conflict 57 | - id: check-docstring-first 58 | - id: check-executables-have-shebangs 59 | - id: check-merge-conflict 60 | - id: check-symlinks 61 | - id: check-xml 62 | - id: mixed-line-ending 63 | args: ["--fix=lf"] 64 | - repo: https://github.com/OCA/pylint-odoo 65 | rev: 7.0.2 66 | hooks: 67 | - id: pylint_odoo 68 | name: pylint with optional checks 69 | args: 70 | - --rcfile=.pylintrc 71 | - --exit-zero 72 | verbose: true 73 | - id: pylint_odoo 74 | args: 75 | - --rcfile=.pylintrc-mandatory 76 | - repo: https://github.com/asottile/pyupgrade 77 | rev: v2.29.0 78 | hooks: 79 | - id: pyupgrade 80 | args: ["--keep-percent-format"] 81 | - repo: https://github.com/acsone/setuptools-odoo 82 | rev: 3.0.3 83 | hooks: 84 | - id: setuptools-odoo-make-default 85 | - id: setuptools-odoo-get-requirements 86 | args: 87 | - --output 88 | - requirements.txt 89 | - --header 90 | - "# generated from manifests external_dependencies" 91 | - repo: https://github.com/PyCQA/flake8 92 | rev: 3.9.2 93 | hooks: 94 | - id: flake8 95 | name: flake8 except __init__.py 96 | exclude: /__init__\.py$ 97 | additional_dependencies: ["flake8-bugbear==20.1.4"] 98 | - id: flake8 99 | name: flake8 only __init__.py 100 | args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py 101 | files: /__init__\.py$ 102 | additional_dependencies: ["flake8-bugbear==20.1.4"] 103 | - repo: https://github.com/PyCQA/isort 104 | rev: 5.12.0 105 | hooks: 106 | - id: isort 107 | name: isort except __init__.py 108 | args: 109 | - --settings=. 110 | exclude: /__init__\.py$ 111 | -------------------------------------------------------------------------------- /static-files/15.0/.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_odoo 3 | score=n 4 | 5 | [ODOOLINT] 6 | readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" 7 | manifest_required_authors=IT Projects Labs 8 | manifest_required_keys=license 9 | manifest_deprecated_keys=description,active 10 | license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 11 | valid_odoo_versions=15.0 12 | 13 | [MESSAGES CONTROL] 14 | disable=all 15 | 16 | # This .pylintrc contains optional AND mandatory checks and is meant to be 17 | # loaded in an IDE to have it check everything, in the hope this will make 18 | # optional checks more visible to contributors who otherwise never look at a 19 | # green travis to see optional checks that failed. 20 | # .pylintrc-mandatory containing only mandatory checks is used the pre-commit 21 | # config as a blocking check. 22 | 23 | enable=anomalous-backslash-in-string, 24 | api-one-deprecated, 25 | api-one-multi-together, 26 | assignment-from-none, 27 | attribute-deprecated, 28 | class-camelcase, 29 | dangerous-default-value, 30 | dangerous-view-replace-wo-priority, 31 | duplicate-id-csv, 32 | duplicate-key, 33 | duplicate-xml-fields, 34 | duplicate-xml-record-id, 35 | eval-referenced, 36 | eval-used, 37 | incoherent-interpreter-exec-perm, 38 | license-allowed, 39 | manifest-author-string, 40 | manifest-deprecated-key, 41 | #manifest-required-author, 42 | manifest-required-key, 43 | manifest-version-format, 44 | method-compute, 45 | method-inverse, 46 | method-required-super, 47 | method-search, 48 | missing-manifest-dependency, 49 | openerp-exception-warning, 50 | pointless-statement, 51 | pointless-string-statement, 52 | print-used, 53 | redundant-keyword-arg, 54 | redundant-modulename-xml, 55 | reimported, 56 | relative-import, 57 | return-in-init, 58 | rst-syntax-error, 59 | sql-injection, 60 | too-few-format-args, 61 | translation-field, 62 | translation-required, 63 | unreachable, 64 | use-vim-comment, 65 | wrong-tabs-instead-of-spaces, 66 | xml-syntax-error, 67 | # messages that do not cause the lint step to fail 68 | consider-merging-classes-inherited, 69 | create-user-wo-reset-password, 70 | dangerous-filter-wo-user, 71 | deprecated-module, 72 | file-not-used, 73 | invalid-commit, 74 | missing-newline-extrafiles, 75 | missing-readme, 76 | no-utf8-coding-comment, 77 | odoo-addons-relative-import, 78 | old-api7-method-defined, 79 | redefined-builtin, 80 | too-complex, 81 | unnecessary-utf8-coding-comment 82 | 83 | [REPORTS] 84 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 85 | output-format=colorized 86 | reports=no 87 | -------------------------------------------------------------------------------- /static-files/15.0/.pylintrc-mandatory: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_odoo 3 | score=n 4 | 5 | [ODOOLINT] 6 | readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" 7 | manifest_required_authors=IT Projects Labs 8 | manifest_required_keys=license 9 | manifest_deprecated_keys=description,active 10 | license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 11 | valid_odoo_versions=15.0 12 | 13 | [MESSAGES CONTROL] 14 | disable=all 15 | 16 | enable=anomalous-backslash-in-string, 17 | api-one-deprecated, 18 | api-one-multi-together, 19 | assignment-from-none, 20 | attribute-deprecated, 21 | class-camelcase, 22 | dangerous-default-value, 23 | dangerous-view-replace-wo-priority, 24 | duplicate-id-csv, 25 | duplicate-key, 26 | duplicate-xml-fields, 27 | duplicate-xml-record-id, 28 | eval-referenced, 29 | eval-used, 30 | incoherent-interpreter-exec-perm, 31 | license-allowed, 32 | manifest-author-string, 33 | manifest-deprecated-key, 34 | #manifest-required-author, 35 | manifest-required-key, 36 | manifest-version-format, 37 | method-compute, 38 | method-inverse, 39 | method-required-super, 40 | method-search, 41 | missing-import-error, 42 | missing-manifest-dependency, 43 | openerp-exception-warning, 44 | pointless-statement, 45 | pointless-string-statement, 46 | print-used, 47 | redundant-keyword-arg, 48 | redundant-modulename-xml, 49 | reimported, 50 | relative-import, 51 | return-in-init, 52 | rst-syntax-error, 53 | sql-injection, 54 | too-few-format-args, 55 | translation-field, 56 | translation-required, 57 | unreachable, 58 | use-vim-comment, 59 | wrong-tabs-instead-of-spaces, 60 | xml-syntax-error 61 | 62 | [REPORTS] 63 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 64 | output-format=colorized 65 | reports=no 66 | -------------------------------------------------------------------------------- /static-files/16.0/.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | exclude: | 2 | (?x) 3 | # Files and folders generated by bots, to avoid loops 4 | ^setup/|/static/description/index\.html$|/i18n/.*\.pot?$| 5 | # Maybe reactivate this when all README files include prettier ignore tags? 6 | ^README\.md$| 7 | # Library files can have extraneous formatting (even minimized) 8 | /lib/| 9 | # Repos using Sphinx to generate docs don't need prettying 10 | ^docs/_templates/.*\.html$| 11 | # You don't usually want a bot to modify your legal texts 12 | (LICENSE.*|COPYING.*) 13 | default_language_version: 14 | python: python3 15 | node: "14.13.0" 16 | repos: 17 | - repo: https://github.com/myint/autoflake 18 | rev: v1.6.1 19 | hooks: 20 | - id: autoflake 21 | args: ["-i", "--ignore-init-module-imports"] 22 | - repo: https://github.com/psf/black 23 | rev: 22.3.0 24 | hooks: 25 | - id: black 26 | - repo: https://github.com/pre-commit/mirrors-prettier 27 | rev: v2.4.1 28 | hooks: 29 | - id: prettier 30 | name: prettier + plugin-xml 31 | additional_dependencies: 32 | - "prettier@2.1.2" 33 | - "@prettier/plugin-xml@0.12.0" 34 | args: 35 | - --plugin=@prettier/plugin-xml 36 | - repo: https://github.com/pre-commit/mirrors-eslint 37 | rev: v7.32.0 38 | hooks: 39 | - id: eslint 40 | verbose: true 41 | args: 42 | - --color 43 | - --fix 44 | - repo: https://github.com/pre-commit/pre-commit-hooks 45 | rev: v4.0.1 46 | hooks: 47 | - id: trailing-whitespace 48 | # exclude autogenerated files 49 | exclude: /README\.rst$ 50 | - id: end-of-file-fixer 51 | # exclude autogenerated files 52 | exclude: /README\.rst$ 53 | - id: debug-statements 54 | - id: fix-encoding-pragma 55 | args: ["--remove"] 56 | - id: check-case-conflict 57 | - id: check-docstring-first 58 | - id: check-executables-have-shebangs 59 | - id: check-merge-conflict 60 | - id: check-symlinks 61 | - id: check-xml 62 | - id: mixed-line-ending 63 | args: ["--fix=lf"] 64 | - repo: https://github.com/OCA/pylint-odoo 65 | rev: 7.0.2 66 | hooks: 67 | - id: pylint_odoo 68 | name: pylint with optional checks 69 | args: 70 | - --rcfile=.pylintrc 71 | - --exit-zero 72 | verbose: true 73 | - id: pylint_odoo 74 | args: 75 | - --rcfile=.pylintrc-mandatory 76 | - repo: https://github.com/asottile/pyupgrade 77 | rev: v2.29.0 78 | hooks: 79 | - id: pyupgrade 80 | args: ["--keep-percent-format"] 81 | - repo: https://github.com/acsone/setuptools-odoo 82 | rev: 3.1.5 83 | hooks: 84 | - id: setuptools-odoo-make-default 85 | - id: setuptools-odoo-get-requirements 86 | args: 87 | - --output 88 | - requirements.txt 89 | - --header 90 | - "# generated from manifests external_dependencies" 91 | - repo: https://github.com/pycqa/flake8 92 | rev: 3.9.2 93 | hooks: 94 | - id: flake8 95 | name: flake8 96 | additional_dependencies: ["flake8-bugbear==21.9.2"] 97 | - repo: https://github.com/PyCQA/isort 98 | rev: 5.12.0 99 | hooks: 100 | - id: isort 101 | name: isort except __init__.py 102 | args: 103 | - --settings=. 104 | exclude: /__init__\.py$ 105 | -------------------------------------------------------------------------------- /static-files/16.0/.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_odoo 3 | score=n 4 | 5 | [ODOOLINT] 6 | readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" 7 | manifest_required_authors=IT Projects Labs 8 | manifest_required_keys=license 9 | manifest_deprecated_keys=description,active 10 | license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 11 | valid_odoo_versions=16.0 12 | 13 | [MESSAGES CONTROL] 14 | disable=all 15 | 16 | # This .pylintrc contains optional AND mandatory checks and is meant to be 17 | # loaded in an IDE to have it check everything, in the hope this will make 18 | # optional checks more visible to contributors who otherwise never look at a 19 | # green travis to see optional checks that failed. 20 | # .pylintrc-mandatory containing only mandatory checks is used the pre-commit 21 | # config as a blocking check. 22 | 23 | enable=anomalous-backslash-in-string, 24 | api-one-deprecated, 25 | api-one-multi-together, 26 | assignment-from-none, 27 | attribute-deprecated, 28 | class-camelcase, 29 | dangerous-default-value, 30 | dangerous-view-replace-wo-priority, 31 | duplicate-id-csv, 32 | duplicate-key, 33 | duplicate-xml-fields, 34 | duplicate-xml-record-id, 35 | eval-referenced, 36 | eval-used, 37 | incoherent-interpreter-exec-perm, 38 | license-allowed, 39 | manifest-author-string, 40 | manifest-deprecated-key, 41 | #manifest-required-author, 42 | manifest-required-key, 43 | manifest-version-format, 44 | method-compute, 45 | method-inverse, 46 | method-required-super, 47 | method-search, 48 | missing-manifest-dependency, 49 | openerp-exception-warning, 50 | pointless-statement, 51 | pointless-string-statement, 52 | print-used, 53 | redundant-keyword-arg, 54 | redundant-modulename-xml, 55 | reimported, 56 | relative-import, 57 | return-in-init, 58 | rst-syntax-error, 59 | sql-injection, 60 | too-few-format-args, 61 | translation-field, 62 | translation-required, 63 | unreachable, 64 | use-vim-comment, 65 | wrong-tabs-instead-of-spaces, 66 | xml-syntax-error, 67 | # messages that do not cause the lint step to fail 68 | consider-merging-classes-inherited, 69 | create-user-wo-reset-password, 70 | dangerous-filter-wo-user, 71 | deprecated-module, 72 | file-not-used, 73 | invalid-commit, 74 | missing-newline-extrafiles, 75 | missing-readme, 76 | no-utf8-coding-comment, 77 | odoo-addons-relative-import, 78 | old-api7-method-defined, 79 | redefined-builtin, 80 | too-complex, 81 | unnecessary-utf8-coding-comment 82 | 83 | [REPORTS] 84 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 85 | output-format=colorized 86 | reports=no 87 | -------------------------------------------------------------------------------- /static-files/16.0/.pylintrc-mandatory: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_odoo 3 | score=n 4 | 5 | [ODOOLINT] 6 | readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" 7 | manifest_required_authors=IT Projects Labs 8 | manifest_required_keys=license 9 | manifest_deprecated_keys=description,active 10 | license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 11 | valid_odoo_versions=16.0 12 | 13 | [MESSAGES CONTROL] 14 | disable=all 15 | 16 | enable=anomalous-backslash-in-string, 17 | api-one-deprecated, 18 | api-one-multi-together, 19 | assignment-from-none, 20 | attribute-deprecated, 21 | class-camelcase, 22 | dangerous-default-value, 23 | dangerous-view-replace-wo-priority, 24 | duplicate-id-csv, 25 | duplicate-key, 26 | duplicate-xml-fields, 27 | duplicate-xml-record-id, 28 | eval-referenced, 29 | eval-used, 30 | incoherent-interpreter-exec-perm, 31 | license-allowed, 32 | manifest-author-string, 33 | manifest-deprecated-key, 34 | #manifest-required-author, 35 | manifest-required-key, 36 | manifest-version-format, 37 | method-compute, 38 | method-inverse, 39 | method-required-super, 40 | method-search, 41 | missing-import-error, 42 | missing-manifest-dependency, 43 | openerp-exception-warning, 44 | pointless-statement, 45 | pointless-string-statement, 46 | print-used, 47 | redundant-keyword-arg, 48 | redundant-modulename-xml, 49 | reimported, 50 | relative-import, 51 | return-in-init, 52 | rst-syntax-error, 53 | sql-injection, 54 | too-few-format-args, 55 | translation-field, 56 | translation-required, 57 | unreachable, 58 | use-vim-comment, 59 | wrong-tabs-instead-of-spaces, 60 | xml-syntax-error 61 | 62 | [REPORTS] 63 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 64 | output-format=colorized 65 | reports=no 66 | -------------------------------------------------------------------------------- /static-files/17.0/.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | exclude: | 2 | (?x) 3 | # Files and folders generated by bots, to avoid loops 4 | ^setup/|/static/description/index\.html$|/i18n/.*\.pot?$| 5 | # Maybe reactivate this when all README files include prettier ignore tags? 6 | ^README\.md$| 7 | # Library files can have extraneous formatting (even minimized) 8 | /lib/| 9 | # Repos using Sphinx to generate docs don't need prettying 10 | ^docs/_templates/.*\.html$| 11 | # You don't usually want a bot to modify your legal texts 12 | (LICENSE.*|COPYING.*) 13 | default_language_version: 14 | python: python3 15 | node: "14.13.0" 16 | repos: 17 | - repo: https://github.com/myint/autoflake 18 | rev: v1.6.1 19 | hooks: 20 | - id: autoflake 21 | args: ["-i", "--ignore-init-module-imports"] 22 | - repo: https://github.com/psf/black 23 | rev: 22.3.0 24 | hooks: 25 | - id: black 26 | - repo: https://github.com/pre-commit/mirrors-prettier 27 | rev: v2.4.1 28 | hooks: 29 | - id: prettier 30 | name: prettier + plugin-xml 31 | additional_dependencies: 32 | - "prettier@2.1.2" 33 | - "@prettier/plugin-xml@0.12.0" 34 | args: 35 | - --plugin=@prettier/plugin-xml 36 | - repo: https://github.com/pre-commit/mirrors-eslint 37 | rev: v8.24.0 38 | hooks: 39 | - id: eslint 40 | verbose: true 41 | args: 42 | - --color 43 | - --fix 44 | - repo: https://github.com/pre-commit/pre-commit-hooks 45 | rev: v4.0.1 46 | hooks: 47 | - id: trailing-whitespace 48 | # exclude autogenerated files 49 | exclude: /README\.rst$ 50 | - id: end-of-file-fixer 51 | # exclude autogenerated files 52 | exclude: /README\.rst$ 53 | - id: debug-statements 54 | - id: fix-encoding-pragma 55 | args: ["--remove"] 56 | - id: check-case-conflict 57 | - id: check-docstring-first 58 | - id: check-executables-have-shebangs 59 | - id: check-merge-conflict 60 | - id: check-symlinks 61 | - id: check-xml 62 | - id: mixed-line-ending 63 | args: ["--fix=lf"] 64 | - repo: https://github.com/OCA/pylint-odoo 65 | rev: 7.0.2 66 | hooks: 67 | - id: pylint_odoo 68 | name: pylint with optional checks 69 | args: 70 | - --rcfile=.pylintrc 71 | - --exit-zero 72 | verbose: true 73 | - id: pylint_odoo 74 | args: 75 | - --rcfile=.pylintrc-mandatory 76 | - repo: https://github.com/asottile/pyupgrade 77 | rev: v2.29.0 78 | hooks: 79 | - id: pyupgrade 80 | args: ["--keep-percent-format"] 81 | #- repo: https://github.com/acsone/setuptools-odoo 82 | # rev: 3.1.5 83 | # hooks: 84 | # - id: setuptools-odoo-make-default 85 | # - id: setuptools-odoo-get-requirements 86 | # args: 87 | # - --output 88 | # - requirements.txt 89 | # - --header 90 | # - "# generated from manifests external_dependencies" 91 | - repo: https://github.com/pycqa/flake8 92 | rev: 3.9.2 93 | hooks: 94 | - id: flake8 95 | name: flake8 96 | additional_dependencies: ["flake8-bugbear==21.9.2"] 97 | - repo: https://github.com/PyCQA/isort 98 | rev: 5.12.0 99 | hooks: 100 | - id: isort 101 | name: isort except __init__.py 102 | args: 103 | - --settings=. 104 | exclude: /__init__\.py$ 105 | -------------------------------------------------------------------------------- /static-files/17.0/.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_odoo 3 | score=n 4 | 5 | [ODOOLINT] 6 | readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" 7 | manifest_required_authors=IT Projects Labs 8 | manifest_required_keys=license 9 | manifest_deprecated_keys=description,active 10 | license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 11 | valid_odoo_versions=17.0 12 | 13 | [MESSAGES CONTROL] 14 | disable=all 15 | 16 | # This .pylintrc contains optional AND mandatory checks and is meant to be 17 | # loaded in an IDE to have it check everything, in the hope this will make 18 | # optional checks more visible to contributors who otherwise never look at a 19 | # green travis to see optional checks that failed. 20 | # .pylintrc-mandatory containing only mandatory checks is used the pre-commit 21 | # config as a blocking check. 22 | 23 | enable=anomalous-backslash-in-string, 24 | api-one-deprecated, 25 | api-one-multi-together, 26 | assignment-from-none, 27 | attribute-deprecated, 28 | class-camelcase, 29 | dangerous-default-value, 30 | dangerous-view-replace-wo-priority, 31 | duplicate-id-csv, 32 | duplicate-key, 33 | duplicate-xml-fields, 34 | duplicate-xml-record-id, 35 | eval-referenced, 36 | eval-used, 37 | incoherent-interpreter-exec-perm, 38 | license-allowed, 39 | manifest-author-string, 40 | manifest-deprecated-key, 41 | #manifest-required-author, 42 | manifest-required-key, 43 | manifest-version-format, 44 | method-compute, 45 | method-inverse, 46 | method-required-super, 47 | method-search, 48 | missing-manifest-dependency, 49 | openerp-exception-warning, 50 | pointless-statement, 51 | pointless-string-statement, 52 | print-used, 53 | redundant-keyword-arg, 54 | redundant-modulename-xml, 55 | reimported, 56 | relative-import, 57 | return-in-init, 58 | rst-syntax-error, 59 | sql-injection, 60 | too-few-format-args, 61 | translation-field, 62 | translation-required, 63 | unreachable, 64 | use-vim-comment, 65 | wrong-tabs-instead-of-spaces, 66 | xml-syntax-error, 67 | # messages that do not cause the lint step to fail 68 | consider-merging-classes-inherited, 69 | create-user-wo-reset-password, 70 | dangerous-filter-wo-user, 71 | deprecated-module, 72 | file-not-used, 73 | invalid-commit, 74 | missing-newline-extrafiles, 75 | missing-readme, 76 | no-utf8-coding-comment, 77 | odoo-addons-relative-import, 78 | old-api7-method-defined, 79 | redefined-builtin, 80 | too-complex, 81 | unnecessary-utf8-coding-comment 82 | 83 | [REPORTS] 84 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 85 | output-format=colorized 86 | reports=no 87 | -------------------------------------------------------------------------------- /static-files/17.0/.pylintrc-mandatory: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | load-plugins=pylint_odoo 3 | score=n 4 | 5 | [ODOOLINT] 6 | readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" 7 | manifest_required_authors=IT Projects Labs 8 | manifest_required_keys=license 9 | manifest_deprecated_keys=description,active 10 | license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3,MIT,Other OSI approved licence,OPL-1 11 | valid_odoo_versions=17.0 12 | 13 | [MESSAGES CONTROL] 14 | disable=all 15 | 16 | enable=anomalous-backslash-in-string, 17 | api-one-deprecated, 18 | api-one-multi-together, 19 | assignment-from-none, 20 | attribute-deprecated, 21 | class-camelcase, 22 | dangerous-default-value, 23 | dangerous-view-replace-wo-priority, 24 | duplicate-id-csv, 25 | duplicate-key, 26 | duplicate-xml-fields, 27 | duplicate-xml-record-id, 28 | eval-referenced, 29 | eval-used, 30 | incoherent-interpreter-exec-perm, 31 | license-allowed, 32 | manifest-author-string, 33 | manifest-deprecated-key, 34 | #manifest-required-author, 35 | manifest-required-key, 36 | manifest-version-format, 37 | method-compute, 38 | method-inverse, 39 | method-required-super, 40 | method-search, 41 | missing-import-error, 42 | missing-manifest-dependency, 43 | openerp-exception-warning, 44 | pointless-statement, 45 | pointless-string-statement, 46 | print-used, 47 | redundant-keyword-arg, 48 | redundant-modulename-xml, 49 | reimported, 50 | relative-import, 51 | return-in-init, 52 | rst-syntax-error, 53 | sql-injection, 54 | too-few-format-args, 55 | translation-field, 56 | translation-required, 57 | unreachable, 58 | use-vim-comment, 59 | wrong-tabs-instead-of-spaces, 60 | xml-syntax-error 61 | 62 | [REPORTS] 63 | msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 64 | output-format=colorized 65 | reports=no 66 | -------------------------------------------------------------------------------- /static-files/all/.editorconfig: -------------------------------------------------------------------------------- 1 | # Configuration for known file extensions 2 | [*.{css,js,json,less,md,py,rst,sass,scss,xml,yaml,yml}] 3 | charset = utf-8 4 | end_of_line = lf 5 | indent_size = 4 6 | indent_style = space 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | 10 | [*.{json,yml,yaml,rst,md}] 11 | indent_size = 2 12 | 13 | # Do not configure editor for libs and autogenerated content 14 | [{*/static/{lib,src/lib}/**,*/static/description/index.html,*/readme/../README.rst}] 15 | charset = unset 16 | end_of_line = unset 17 | indent_size = unset 18 | indent_style = unset 19 | insert_final_newline = false 20 | trim_trailing_whitespace = false 21 | -------------------------------------------------------------------------------- /static-files/all/.eslintrc.yml: -------------------------------------------------------------------------------- 1 | env: 2 | browser: true 3 | es6: true 4 | 5 | # See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449 6 | parserOptions: 7 | ecmaVersion: 2022 8 | sourceType: module 9 | 10 | # Globals available in Odoo that shouldn't produce errorings 11 | globals: 12 | _: readonly 13 | $: readonly 14 | fuzzy: readonly 15 | jQuery: readonly 16 | moment: readonly 17 | odoo: readonly 18 | openerp: readonly 19 | Promise: readonly 20 | owl: readonly 21 | 22 | # Styling is handled by Prettier, so we only need to enable AST rules; 23 | # see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890 24 | rules: 25 | accessor-pairs: warn 26 | array-callback-return: warn 27 | callback-return: warn 28 | capitalized-comments: 29 | - warn 30 | - always 31 | - ignoreConsecutiveComments: true 32 | ignoreInlineComments: true 33 | complexity: 34 | - warn 35 | - 15 36 | constructor-super: warn 37 | dot-notation: warn 38 | eqeqeq: warn 39 | global-require: warn 40 | handle-callback-err: warn 41 | id-blacklist: warn 42 | id-match: warn 43 | init-declarations: error 44 | max-depth: warn 45 | max-nested-callbacks: warn 46 | max-statements-per-line: warn 47 | no-alert: warn 48 | no-array-constructor: warn 49 | no-caller: warn 50 | no-case-declarations: warn 51 | no-class-assign: warn 52 | no-cond-assign: error 53 | no-const-assign: error 54 | no-constant-condition: warn 55 | no-control-regex: warn 56 | no-debugger: error 57 | no-delete-var: warn 58 | no-div-regex: warn 59 | no-dupe-args: error 60 | no-dupe-class-members: error 61 | no-dupe-keys: error 62 | no-duplicate-case: error 63 | no-duplicate-imports: error 64 | no-else-return: warn 65 | no-empty-character-class: warn 66 | no-empty-function: error 67 | no-empty-pattern: error 68 | no-empty: warn 69 | no-eq-null: error 70 | no-eval: error 71 | no-ex-assign: error 72 | no-extend-native: warn 73 | no-extra-bind: warn 74 | no-extra-boolean-cast: warn 75 | no-extra-label: warn 76 | no-fallthrough: warn 77 | no-func-assign: error 78 | no-global-assign: error 79 | no-implicit-coercion: 80 | - warn 81 | - allow: ["~"] 82 | no-implicit-globals: warn 83 | no-implied-eval: warn 84 | no-inline-comments: warn 85 | no-inner-declarations: warn 86 | no-invalid-regexp: warn 87 | no-irregular-whitespace: warn 88 | no-iterator: warn 89 | no-label-var: warn 90 | no-labels: warn 91 | no-lone-blocks: warn 92 | no-lonely-if: error 93 | no-mixed-requires: error 94 | no-multi-str: warn 95 | no-native-reassign: error 96 | no-negated-condition: warn 97 | no-negated-in-lhs: error 98 | no-new-func: warn 99 | no-new-object: warn 100 | no-new-require: warn 101 | no-new-symbol: warn 102 | no-new-wrappers: warn 103 | no-new: warn 104 | no-obj-calls: warn 105 | no-octal-escape: warn 106 | no-octal: warn 107 | no-param-reassign: off 108 | no-path-concat: warn 109 | no-process-env: warn 110 | no-process-exit: warn 111 | no-proto: warn 112 | no-prototype-builtins: warn 113 | no-redeclare: warn 114 | no-regex-spaces: warn 115 | no-restricted-globals: warn 116 | no-restricted-imports: warn 117 | no-restricted-modules: warn 118 | no-restricted-syntax: warn 119 | no-return-assign: error 120 | no-script-url: warn 121 | no-self-assign: warn 122 | no-self-compare: warn 123 | no-sequences: warn 124 | no-shadow-restricted-names: warn 125 | no-shadow: warn 126 | no-sparse-arrays: warn 127 | no-sync: warn 128 | no-this-before-super: warn 129 | no-throw-literal: warn 130 | no-undef-init: warn 131 | no-undef: error 132 | no-unmodified-loop-condition: warn 133 | no-unneeded-ternary: error 134 | no-unreachable: error 135 | no-unsafe-finally: error 136 | no-unused-expressions: error 137 | no-unused-labels: error 138 | no-unused-vars: 139 | - error 140 | - args: none 141 | no-use-before-define: error 142 | no-useless-call: warn 143 | no-useless-computed-key: warn 144 | no-useless-concat: warn 145 | no-useless-constructor: warn 146 | no-useless-escape: warn 147 | no-useless-rename: warn 148 | no-void: warn 149 | no-with: warn 150 | operator-assignment: [error, always] 151 | prefer-const: warn 152 | radix: warn 153 | require-yield: warn 154 | sort-imports: warn 155 | spaced-comment: [error, always] 156 | space-before-function-paren: ["warn", { "anonymous": "always", "named": "never" }] 157 | strict: [error, function] 158 | use-isnan: error 159 | valid-jsdoc: 160 | - warn 161 | - prefer: 162 | arg: param 163 | argument: param 164 | augments: extends 165 | constructor: class 166 | exception: throws 167 | func: function 168 | method: function 169 | prop: property 170 | return: returns 171 | virtual: abstract 172 | yield: yields 173 | preferType: 174 | array: Array 175 | bool: Boolean 176 | boolean: Boolean 177 | number: Number 178 | object: Object 179 | str: String 180 | string: String 181 | requireParamDescription: false 182 | requireReturn: false 183 | requireReturnDescription: false 184 | requireReturnType: false 185 | valid-typeof: warn 186 | yoda: warn 187 | -------------------------------------------------------------------------------- /static-files/all/.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 80 3 | max-complexity = 16 4 | # B = bugbear 5 | # B9 = bugbear opinionated (incl line length) 6 | select = C,E,F,W,B,B9 7 | # E203: whitespace before ':' (black behaviour) 8 | # E501: flake8 line length (covered by bugbear B950) 9 | # W503: line break before binary operator (black behaviour) 10 | # C901: "method is too complex" -- it's too complex to fix existing modules. Disable for now 11 | ignore = E203,E501,W503,B950,C901 12 | per-file-ignores= 13 | __init__.py:F401 14 | -------------------------------------------------------------------------------- /static-files/all/.github/workflows/DINAR-PORT.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 IT Projects Labs 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | name: "Port module" 15 | 16 | on: 17 | issues: 18 | types: 19 | - opened 20 | - reopened 21 | 22 | jobs: 23 | port: 24 | runs-on: ubuntu-latest 25 | if: "startsWith(github.event.issue.title, 'DINAR-PORT ')" 26 | steps: 27 | - name: Post link 28 | uses: KeisukeYamashita/create-comment@v1 29 | with: 30 | comment: 31 | "Porting is started. Check logs: https://github.com/${{ github.repository 32 | }}/actions/runs/${{ github.run_id }}" 33 | - name: Checkout DINAR 34 | uses: actions/checkout@v2 35 | with: 36 | path: DINAR 37 | repository: itpp-labs/DINAR 38 | ref: master 39 | - uses: actions/setup-python@v4 40 | with: 41 | python-version: "3.10" 42 | - name: Install python tools 43 | run: | 44 | pip install plumbum pre-commit git-aggregator 45 | - name: Check Python Version 46 | run: 47 | echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> 48 | $GITHUB_ENV 49 | - name: Analyze request 50 | env: 51 | TITLE: ${{ github.event.issue.title }} 52 | run: | 53 | # sets environment variables that available in next steps via $ {{ env.PORT_... }} notation 54 | python DINAR/workflow-files/analyze_port_trigger.py "$TITLE" 55 | - name: Checkout Repo 56 | uses: actions/checkout@v2 57 | with: 58 | path: REPO 59 | fetch-depth: 0 60 | ref: ${{ env.PORT_TO_BRANCH }} 61 | - uses: actions/cache@v4 62 | with: 63 | path: ~/.cache/pre-commit 64 | key: pre-commit|${{ env.PY }}|${{ hashFiles('REPO/.pre-commit-config.yaml') }} 65 | - name: Copy module to new branch 66 | run: | 67 | git config --global user.email "itpp-bot@users.noreply.github.com" 68 | git config --global user.name "Mitchell Admin" 69 | cd REPO 70 | if [ ! -d ${{ env.PORT_MODULE }} ] 71 | then 72 | # apply original commit history 73 | if ! git format-patch --keep-subject --stdout origin/${{ env.PORT_TO_BRANCH }}..origin/${{ env.PORT_FROM_BRANCH }} -- ${{ env.PORT_MODULE }} | git am -3 --keep 74 | then 75 | # git am failed 76 | git am --abort 77 | fi 78 | fi 79 | if [ ! -d ${{ env.PORT_MODULE }} ] 80 | then 81 | # just copy source 82 | git checkout origin/${{ env.PORT_FROM_BRANCH }} -- ${{ env.PORT_MODULE }} 83 | git commit -m ":tada:${{ env.PORT_FROM_BRANCH_TAGS }} ${{ env.PORT_MODULE }} 84 | previous commits history: https://github.com/${{ github.repository }}/commits/${{ env.PORT_FROM_BRANCH }}/${{ env.PORT_MODULE }} 85 | > Made via .github/workflows/DINAR-PORT.yml" 86 | fi 87 | - name: make OCA/odoo-module-migrator 88 | run: | 89 | gitaggregate -c DINAR/workflow-files/odoo-module-migrator-mix.yml 90 | pip install -e ./odoo-module-migrator 91 | - name: apply OCA/odoo-module-migrator 92 | run: | 93 | LOG_FILE=../odoo-module-migrator.logs 94 | cd REPO 95 | odoo-module-migrate \ 96 | --modules ${{ env.PORT_MODULE }} \ 97 | --init-version-name ${{ env.PORT_FROM_BRANCH }} \ 98 | --target-version-name ${{ env.PORT_TO_BRANCH }} \ 99 | --no-commit \ 100 | --no-pre-commit \ 101 | 2> $LOG_FILE || true 102 | cat $LOG_FILE 103 | 104 | # remove colors 105 | sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" $LOG_FILE 106 | # escape character 107 | # TODO: update KeisukeYamashita/create-comment to support reading comment's body from file 108 | echo 'MIGRATOR_LOGS<> $GITHUB_ENV 109 | cat $LOG_FILE >> $GITHUB_ENV 110 | echo 'EOF' >> $GITHUB_ENV 111 | 112 | git add -A 113 | git commit -m ":arrow_up:${{ env.PORT_TO_BRANCH_TAGS }} OCA/odoo-module-migrator 114 | 115 | close #${{ github.event.issue.number }} 116 | 117 | > Made via .github/workflows/DINAR-PORT.yml" 118 | - name: pre-commit 119 | run: | 120 | cd REPO 121 | pre-commit run --files $(find ${{ env.PORT_MODULE }} -type f) || true 122 | git add -A 123 | git commit -m ":rainbow: pre-commit 124 | > Made via .github/workflows/DINAR-PORT.yml" || echo "pre-commit: no changes" 125 | - name: PR 126 | uses: peter-evans/create-pull-request@v3 127 | id: cpr 128 | with: 129 | path: REPO 130 | # GITHUB_TOKEN would not trigger PR checks 131 | token: ${{ secrets.DINAR_TOKEN }} 132 | branch: ${{ env.PORT_TO_BRANCH }}-${{ env.PORT_MODULE }} 133 | title: "[${{ env.PORT_TO_BRANCH }}] ${{ env.PORT_MODULE }}" 134 | body: | 135 | Made by [DINAR](https://github.com/itpp-labs/DINAR#readme) by request in #${{ github.event.issue.number }} 136 | - name: Post logs 137 | uses: KeisukeYamashita/create-comment@v1 138 | with: 139 | number: ${{ steps.cpr.outputs.pull-request-number }} 140 | comment: | 141 | [Migrator](https://github.com/OCA/odoo-module-migrator/)'s [logs](https://github.com/${{ github.repository 142 | }}/actions/runs/${{ github.run_id }}): 143 | 144 | ``` 145 | ${{ env.MIGRATOR_LOGS }} 146 | ``` 147 | -------------------------------------------------------------------------------- /static-files/all/.github/workflows/DINAR-pr.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 IT Projects Labs 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | name: "DINAR" 15 | 16 | on: 17 | pull_request: 18 | 19 | jobs: 20 | pre-commit: 21 | name: "pre-commit" 22 | # Let Quick Review/Tests run first 23 | needs: 24 | - review 25 | - tests 26 | runs-on: ubuntu-latest 27 | steps: 28 | - name: Checkout Repo 29 | uses: actions/checkout@v2 30 | - uses: actions/setup-python@v4 31 | with: 32 | python-version: "3.10" 33 | - name: Check Python Version 34 | run: 35 | echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> 36 | $GITHUB_ENV 37 | - uses: actions/cache@v4 38 | with: 39 | path: ~/.cache/pre-commit 40 | key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} 41 | - uses: pre-commit/action@v1.0.1 42 | 43 | review: 44 | name: "Quick Review" 45 | runs-on: ubuntu-latest 46 | steps: 47 | - name: Checkout Repo 48 | uses: actions/checkout@v2 49 | with: 50 | path: REPO 51 | - name: Checkout DINAR 52 | uses: actions/checkout@v2 53 | with: 54 | path: DINAR 55 | repository: itpp-labs/DINAR 56 | ref: master 57 | - uses: actions/setup-python@v4 58 | with: 59 | python-version: "3.10" 60 | - name: Install python tools 61 | run: | 62 | pip install plumbum PyGithub pyyaml 63 | - name: Analyze PR 64 | run: | 65 | # sets environment variables that available in next steps via $ {{ env.PR_... }} notation 66 | cd REPO 67 | python ../DINAR/workflow-files/analyze-modules.py updated ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.event.number }} 68 | - name: Configure docker 69 | run: | 70 | bash DINAR/workflow-files/configure-docker.sh ${{ secrets.DINAR_TOKEN || secrets.GITHUB_TOKEN }} 71 | echo "PR_FILES=../../REPO" >> $GITHUB_ENV 72 | - name: HOW TO RUN ODOO LOCALLY 73 | if: always() 74 | run: | 75 | export MODULES=${{ env.PR_MODULES }} 76 | export LOAD_MODULES=${{ env.PR_MODULES_LOAD }} 77 | export PR_NUM=${{ github.event.number }} 78 | export VERSION=${{ github.event.pull_request.base.ref }} 79 | export REVISION_PR=${{ github.event.pull_request.head.sha}} 80 | export DINAR_REPO="itpp-labs/DINAR" 81 | bash DINAR/workflow-files/how-to-run-locally.sh 82 | - name: Check Python Version 83 | run: 84 | echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> 85 | $GITHUB_ENV 86 | - uses: actions/cache@v4 87 | with: 88 | path: ~/.cache/pre-commit 89 | key: pre-commit|${{ env.PY }}|${{ hashFiles('REPO/.pre-commit-config.yaml') }} 90 | - name: Install pre-commit 91 | run: | 92 | pip install pre-commit 93 | - name: PRE-COMMIT against updated files only 94 | run: | 95 | cd REPO 96 | git fetch origin ${{ github.event.pull_request.base.ref }} 97 | echo "CHANGED FILES:" 98 | git diff --name-only --no-ext-diff FETCH_HEAD..HEAD -- . 99 | echo "RUN PRE-COMMIT:" 100 | pre-commit run --show-diff-on-failure --color=always --show-diff-on-failure --files $(git diff --name-only --no-ext-diff FETCH_HEAD..HEAD -- .) 101 | 102 | tests: 103 | name: "Quick Tests" 104 | runs-on: ubuntu-latest 105 | steps: 106 | - name: Checkout Repo 107 | uses: actions/checkout@v2 108 | with: 109 | path: REPO 110 | - name: Checkout DINAR 111 | uses: actions/checkout@v2 112 | with: 113 | path: DINAR 114 | repository: itpp-labs/DINAR 115 | ref: master 116 | - name: Configure docker 117 | run: | 118 | bash DINAR/workflow-files/configure-docker.sh ${{ secrets.DINAR_TOKEN || secrets.GITHUB_TOKEN }} 119 | echo "PR_FILES=../../REPO" >> $GITHUB_ENV 120 | - name: Install python tools 121 | run: | 122 | pip install plumbum PyGithub pyyaml 123 | - name: Download Docker images with preinstalled modules 124 | run: | 125 | docker compose -p dinar -f DINAR/workflow-files/docker-compose-DINAR-pr.yml config 126 | docker compose -p dinar -f DINAR/workflow-files/docker-compose-DINAR-pr.yml pull 127 | docker compose -p dinar -f DINAR/workflow-files/docker-compose-DINAR-pr.yml up --no-start 128 | - name: Analyze PR 129 | run: | 130 | # Get list of installed modules 131 | ODOO_BASE_MODULES=$(docker inspect \ 132 | --format '{{ index .Config.Labels "dinar.odoo.modules"}}' \ 133 | dinar-odoo-1) 134 | echo "ODOO_BASE_MODULES=$ODOO_BASE_MODULES" 135 | 136 | # sets environment variables that available in next steps via $ {{ env.PR_... }} notation 137 | cd REPO 138 | python ../DINAR/workflow-files/analyze-modules.py updated ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.event.number }} $ODOO_BASE_MODULES 139 | - name: Install json parser 140 | run: | 141 | sudo apt-get install jq 142 | - name: Install Additional Dependencies (Modules) 143 | if: env.PR_MODULES_DEPS != '' 144 | run: | 145 | # Install new dependencies without tests 146 | export MODULES="${{ env.PR_MODULES_DEPS }}" 147 | export LOAD_MODULES="${{ env.PR_MODULES_LOAD }}" 148 | docker compose -p dinar -f DINAR/workflow-files/docker-compose-DINAR-pr.yml config 149 | docker compose -p dinar -f DINAR/workflow-files/docker-compose-DINAR-pr.yml up --abort-on-container-exit 150 | - name: Install Additional Dependencies (Packages) 151 | if: env.PR_DEPS != '' 152 | run: | 153 | # TODO https://github.com/itpp-labs/DINAR/issues/42 154 | exit 1 155 | - name: Prepare Artifact Folder 156 | run: | 157 | mkdir new-deps/ 158 | # create dummy file to be sure that Artifact will be uploaded 159 | echo ok > new-deps/.empty 160 | echo "ARTIFACT=empty" >> $GITHUB_ENV 161 | - name: Prepare DINAR with additional dependencies 162 | if: env.PR_MODULES_DEPS != '' || env.PR_DEPS != '' 163 | run: | 164 | # Save artifacts for local run and for integrations Tests 165 | bash DINAR/workflow-files/save-docker-layers.sh new-deps/ 166 | echo "${{ env.PR_MODULES_DEPS }}" > new-deps/modules.txt 167 | echo "ARTIFACT=yes" >> $GITHUB_ENV 168 | - name: Save DINAR with dependencies 169 | uses: actions/upload-artifact@v4 170 | with: 171 | name: new-deps 172 | path: new-deps/ 173 | - name: HOW TO RUN QUICK TESTS LOCALLY 174 | if: always() 175 | run: | 176 | export MODULES=${{ env.PR_MODULES }} 177 | export LOAD_MODULES=${{ env.PR_MODULES_LOAD }} 178 | export PR_NUM=${{ github.event.number }} 179 | export VERSION=${{ github.event.pull_request.base.ref }} 180 | export REVISION_PR=${{ github.event.pull_request.head.sha}} 181 | export DINAR_REPO="itpp-labs/DINAR-fork" 182 | export ODOO_EXTRA_ARG=--test-enable 183 | bash DINAR/workflow-files/how-to-run-locally.sh ${{ secrets.GITHUB_TOKEN }} 184 | - name: Test updated modules 185 | if: env.PR_MODULES != '' 186 | run: | 187 | export MODULES="${{ env.PR_MODULES }}" 188 | export LOAD_MODULES="${{ env.PR_MODULES_LOAD }}" 189 | export ODOO_EXTRA_ARG=--test-enable 190 | docker compose -p dinar -f DINAR/workflow-files/docker-compose-DINAR-pr.yml config 191 | docker compose -p dinar -f DINAR/workflow-files/docker-compose-DINAR-pr.yml up --abort-on-container-exit 192 | 193 | tests-all: 194 | name: Integration Tests 195 | # Let Quick Review/Tests run first 196 | # This job uses artifacts from "Quick Tests" 197 | needs: 198 | - tests 199 | - review 200 | runs-on: ubuntu-latest 201 | steps: 202 | - name: Checkout Repo 203 | uses: actions/checkout@v2 204 | with: 205 | path: REPO 206 | - name: Checkout DINAR 207 | uses: actions/checkout@v2 208 | with: 209 | path: DINAR 210 | repository: itpp-labs/DINAR 211 | ref: master 212 | - name: Install python tools 213 | run: | 214 | pip install plumbum pyyaml 215 | - name: Download Additional Dependencies artifact 216 | uses: actions/download-artifact@v1 217 | with: 218 | name: new-deps 219 | path: new-deps/ 220 | - name: Check artifact 221 | run: | 222 | if [ ! -f new-deps/modules.txt ]; then 223 | echo "ARTIFACT=empty" >> $GITHUB_ENV 224 | fi 225 | - name: Configure Docker 226 | run: | 227 | bash DINAR/workflow-files/configure-docker.sh ${{ secrets.DINAR_TOKEN || secrets.GITHUB_TOKEN }} 228 | echo "PR_FILES=../../REPO" >> $GITHUB_ENV 229 | - name: Analyze PR 230 | run: | 231 | # sets environment variables that available in next steps via $ {{ env.PR_... }} notation 232 | DEPS_MODULES=$(cat new-deps/modules.txt || true) 233 | cd REPO 234 | python ../DINAR/workflow-files/analyze-modules.py all "$DEPS_MODULES" 235 | - name: Install json parser 236 | run: | 237 | sudo apt-get install jq 238 | - name: HOW TO RUN TESTS LOCALLY 239 | if: always() 240 | run: | 241 | export MODULES=${{ env.ALL_MODULES }} 242 | export LOAD_MODULES=${{ env.ALL_MODULES_LOAD }} 243 | export PR_NUM=${{ github.event.number }} 244 | export VERSION=${{ github.event.pull_request.base.ref }} 245 | export REVISION_PR=${{ github.event.pull_request.head.sha}} 246 | export DINAR_REPO="itpp-labs/DINAR" 247 | export ODOO_EXTRA_ARG=--test-enable 248 | bash DINAR/workflow-files/how-to-run-locally.sh ${{ secrets.GITHUB_TOKEN }} 249 | - name: Download base images 250 | run: | 251 | docker compose -p dinar -f DINAR/workflow-files/docker-compose-DINAR-pr.yml config 252 | docker compose -p dinar -f DINAR/workflow-files/docker-compose-DINAR-pr.yml pull 253 | docker compose -p dinar -f DINAR/workflow-files/docker-compose-DINAR-pr.yml up --no-start 254 | - name: Apply new-deps artifact 255 | if: env.ARTIFACT != 'empty' 256 | run: | 257 | bash DINAR/workflow-files/load-docker-layers.sh new-deps/ 258 | - name: Test all modules 259 | run: | 260 | export MODULES="${{ env.ALL_MODULES }}" 261 | export LOAD_MODULES="${{ env.ALL_MODULES_LOAD }}" 262 | export ODOO_EXTRA_ARG=--test-enable 263 | docker compose -p dinar -f DINAR/workflow-files/docker-compose-DINAR-pr.yml config 264 | docker compose -p dinar -f DINAR/workflow-files/docker-compose-DINAR-pr.yml up --abort-on-container-exit 265 | -------------------------------------------------------------------------------- /static-files/all/.github/workflows/DINAR.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 IT Projects Labs 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | name: "DINAR: Docker Image Building" 15 | 16 | on: 17 | push: 18 | paths: 19 | - ".DINAR/**" 20 | - ".github/workflows/DINAR.yml" 21 | 22 | # Cron works only for defaul branch. See https://github.com/itpp-labs/DINAR/issues/48 23 | schedule: 24 | - cron: "5 5 * * 0" 25 | 26 | jobs: 27 | check-secret: 28 | runs-on: ubuntu-latest 29 | steps: 30 | - name: Check that DINAR_TOKEN is set 31 | run: | 32 | if [ -z "${{ secrets.DINAR_TOKEN }}" ] 33 | then 34 | echo "DINAR_TOKEN is not set" 35 | exit 1 36 | fi 37 | 38 | check-branch: 39 | runs-on: ubuntu-latest 40 | steps: 41 | - name: Check that this branch needs docker images 42 | run: | 43 | REF=${GITHUB_BASE_REF:-${GITHUB_REF}} 44 | BRANCH=${REF##*/} 45 | CHECK=$( echo "$BRANCH" | grep -E "^(master|[0-9]+\.[0-9]+)(-dev-.+)?$" || true) 46 | if [ -z "$CHECK" ] 47 | then 48 | echo "This branch is not supposed to be a target of pull requests, so docker image is not needed." 49 | echo "For information check https://github.com/itpp-labs/DINAR/issues/60" 50 | exit 1 51 | fi 52 | 53 | rebuild-images: 54 | runs-on: ubuntu-latest 55 | needs: 56 | - check-secret 57 | - check-branch 58 | steps: 59 | - name: Checkout Repo 60 | uses: actions/checkout@v4 61 | with: 62 | path: REPO 63 | - name: Checkout DINAR 64 | uses: actions/checkout@v4 65 | with: 66 | path: DINAR 67 | repository: itpp-labs/DINAR 68 | ref: master 69 | - uses: actions/setup-python@v4 70 | with: 71 | python-version: "3.10" 72 | - name: Prepare build folder 73 | run: | 74 | cp -rnT DINAR/embedded-files/ REPO/ 75 | 76 | - name: Configure Docker 77 | run: | 78 | bash DINAR/workflow-files/configure-docker.sh ${{ secrets.DINAR_TOKEN }} 79 | 80 | cat <<- EOF > REPO/.DINAR/image/.netrc 81 | machine github.com 82 | login $GITHUB_ACTOR 83 | password ${{ secrets.DINAR_TOKEN }} 84 | EOF 85 | - name: Build ${{ env.IMAGE_ODOO_BASE }} 86 | uses: elgohr/Publish-Docker-Github-Action@v4 87 | env: 88 | LOCAL_CUSTOM_DIR: ./image 89 | AGGREGATE: true 90 | PIP_INSTALL_ODOO: false 91 | CLEAN: false 92 | COMPILE: false 93 | with: 94 | name: ${{ env.IMAGE_ODOO_BASE }} 95 | registry: ${{ env.REGISTRY }} 96 | username: ${{ env.REGISTRY_USERNAME }} 97 | password: ${{ env.REGISTRY_PASSWORD }} 98 | buildargs: ODOO_VERSION,AGGREGATE,PIP_INSTALL_ODOO,CLEAN,COMPILE,LOCAL_CUSTOM_DIR 99 | workdir: REPO/.DINAR/ 100 | - name: Install python tools 101 | run: | 102 | pip install plumbum pyyaml 103 | - name: Compute Modules Dependencies 104 | run: | 105 | # sets environment variables that available in next steps via $ {{ env.VAR_NAME }} notation 106 | cd REPO 107 | python ../DINAR/workflow-files/analyze-modules.py all 108 | - name: Install Base Addons 109 | run: | 110 | export MODULES=$ALL_MODULES_DEPENDENCIES 111 | 112 | export DOODBA_WITHOUT_DEMO=all 113 | bash DINAR/workflow-files/images-with-preinstalled-modules.sh $IMAGE_DB-nodemo $IMAGE_ODOO-nodemo 114 | 115 | export DOODBA_WITHOUT_DEMO=false 116 | bash DINAR/workflow-files/images-with-preinstalled-modules.sh $IMAGE_DB $IMAGE_ODOO 117 | -------------------------------------------------------------------------------- /static-files/all/.prettierrc.yml: -------------------------------------------------------------------------------- 1 | # Defaults for all prettier-supported languages. 2 | # Prettier will complete this with settings from .editorconfig file. 3 | bracketSpacing: true 4 | printWidth: 88 5 | proseWrap: always 6 | semi: true 7 | trailingComma: "es5" 8 | xmlWhitespaceSensitivity: "ignore" 9 | -------------------------------------------------------------------------------- /workflow-files/analyze-modules.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 IT Projects Labs 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import ast 15 | import itertools 16 | import os.path 17 | import sys 18 | 19 | import yaml 20 | from plumbum.cmd import cat, echo 21 | 22 | try: 23 | from github import Github 24 | except ImportError: 25 | pass 26 | 27 | MANIFESTS = ["__manifest__.py", "__openerp__.py"] 28 | # https://odoo-development.readthedocs.io/en/latest/admin/server_wide_modules.html 29 | DEFAULT_SERVER_WIDE_MODULES = { 30 | "14.0": ["base", "web"], 31 | "13.0": ["base", "web"], 32 | "12.0": ["base", "web"], 33 | "11.0": ["web"], 34 | "10.0": ["web", "web_kanban"], 35 | } 36 | 37 | 38 | def action_updated(token, repository, pull_number, dinar_odoo_base_modules): 39 | github = Github(token) 40 | repo = github.get_repo(repository) 41 | pr = repo.get_pull(int(pull_number)) 42 | changed_files = [f.filename for f in pr.get_files()] 43 | 44 | other_folders = {} 45 | root_files = [] 46 | manifests = {} 47 | for f in changed_files: 48 | if "/" not in f: 49 | root_files.append(f) 50 | continue 51 | module_name = f.split("/")[0] 52 | if module_name in manifests: 53 | # already handled 54 | continue 55 | manifest_path = module_name2manifest_path(module_name) 56 | if manifest_path: 57 | manifests[module_name] = manifest_path 58 | else: 59 | # no manifest in the folder 60 | other_folders.setdefault(module_name, []) 61 | other_folders[module_name].append(f) 62 | 63 | addons_config = get_addons_config() 64 | exclude = addons_config.get("exclude", []) 65 | 66 | modules_data = parse_manifests(manifests) 67 | modules_data = { 68 | m: data 69 | for m, data in modules_data.items() 70 | if data["manifest"].get("installable", True) and m not in exclude 71 | } 72 | 73 | set_github_var("PR_MODULES_LOAD", server_wide_modules(modules_data)) 74 | set_github_var("PR_MODULES", ",".join(modules_data.keys())) 75 | set_github_var( 76 | "PR_MODULES_DEPS", modules2deps(modules_data, set(), dinar_odoo_base_modules) 77 | ) 78 | # TODO: set to value "1" if there are changes in .DINAR/image/ 79 | # https://github.com/itpp-labs/DINAR/issues/42 80 | set_github_var("PR_DEPS", "") 81 | 82 | 83 | def get_addons_config(): 84 | # TODO: addons.yaml may differs from what base image has. 85 | try: 86 | with open(".DINAR/config.yaml") as config_file: 87 | config = yaml.safe_load(config_file) 88 | except Exception as e: 89 | print("Error on parsing .DINAR/config.yaml: %s" % e) 90 | return {} 91 | return config.get("addons", {}) 92 | 93 | 94 | def action_all(): 95 | # List all available modules 96 | ROOT = "." 97 | folders = [ 98 | name for name in os.listdir(ROOT) if os.path.isdir(os.path.join(ROOT, name)) 99 | ] 100 | manifests = {} 101 | for module_name in folders: 102 | manifest_path = module_name2manifest_path(module_name) 103 | if manifest_path: 104 | manifests[module_name] = manifest_path 105 | addons_config = get_addons_config() 106 | include = addons_config.get("include", ["base"]) 107 | exclude = addons_config.get("exclude", []) 108 | 109 | modules_data = parse_manifests(manifests) 110 | modules_data = { 111 | m: data 112 | for m, data in modules_data.items() 113 | if data["manifest"].get("installable", True) and m not in exclude 114 | } 115 | 116 | set_github_var("ALL_MODULES_LOAD", server_wide_modules(modules_data)) 117 | set_github_var("ALL_MODULES", ",".join(modules_data.keys())) 118 | set_github_var("ALL_MODULES_DEPENDENCIES", modules2deps(modules_data, include)) 119 | 120 | 121 | def module_name2manifest_path(module_name): 122 | for m_py in MANIFESTS: 123 | manifest_path = os.path.join(module_name, m_py) 124 | if not os.path.exists(manifest_path): 125 | # no such manifest 126 | continue 127 | return manifest_path 128 | 129 | 130 | def parse_manifests(manifests): 131 | modules_data = {} 132 | for module_name, manifest_path in manifests.items(): 133 | try: 134 | manifest_data = ast.literal_eval(cat(manifest_path)) 135 | except Exception: 136 | manifest_data = {"error": "cannot parse"} 137 | modules_data[module_name] = {"manifest": manifest_data} 138 | 139 | return modules_data 140 | 141 | 142 | def modules2deps(modules_data, include=None, exclude=None): 143 | include = include or set() 144 | exclude = exclude or set() 145 | dependencies = list( 146 | itertools.chain.from_iterable( 147 | m["manifest"].get("depends", []) for m in modules_data.values() 148 | ) 149 | ) 150 | return ",".join( 151 | (set(include) | set(dependencies)) - set(modules_data.keys()) - set(exclude) 152 | ) 153 | 154 | 155 | def server_wide_modules(modules_data): 156 | odoo_version = os.environ.get("ODOO_VERSION", "13.0") 157 | mandatory_modules = DEFAULT_SERVER_WIDE_MODULES.get(odoo_version, ["web", "base"]) 158 | addons_config = get_addons_config() 159 | repo_modules = addons_config.get("server_wide_modules", []) 160 | return ",".join( 161 | set(mandatory_modules) | (set(repo_modules) & set(modules_data.keys())) 162 | ) 163 | 164 | 165 | def cmd(command): 166 | print(command) 167 | print(command()) 168 | 169 | 170 | def set_github_var(name, value): 171 | s = "{}={}".format(name, value) 172 | print(s) 173 | (echo[s] >> os.environ.get("GITHUB_ENV"))() 174 | 175 | 176 | if __name__ == "__main__": 177 | print(sys.argv) 178 | action = sys.argv[1] 179 | if action == "updated": 180 | token = sys.argv[2] 181 | repository = sys.argv[3] 182 | pull_number = sys.argv[4] 183 | try: 184 | dinar_odoo_base_modules = sys.argv[5] 185 | dinar_odoo_base_modules = dinar_odoo_base_modules.split(",") 186 | except Exception: 187 | dinar_odoo_base_modules = [] 188 | action_updated(token, repository, pull_number, dinar_odoo_base_modules) 189 | else: 190 | action_all() 191 | -------------------------------------------------------------------------------- /workflow-files/analyze_port_trigger.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 IT Projects Labs 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # TODO: rename analyze-modules.py file 15 | import importlib 16 | import sys 17 | 18 | # TODO: make a python package, say dinarlib, to use local imports 19 | from branch2odoo_version import ODOO_VERSIONS, branch2version 20 | 21 | analyze_modules = importlib.import_module("analyze-modules") 22 | set_github_var = analyze_modules.set_github_var 23 | 24 | 25 | TAGS = { 26 | "1": "one", 27 | "2": "two", 28 | "3": "three", 29 | "4": "four", 30 | "5": "five", 31 | "6": "six", 32 | "7": "seven", 33 | "8": "eight", 34 | "9": "nine", 35 | "0": "zero", 36 | } 37 | 38 | 39 | def get_prev_version(version): 40 | return ODOO_VERSIONS[ODOO_VERSIONS.index(version) + 1] 41 | 42 | 43 | if __name__ == "__main__": 44 | print(sys.argv) 45 | title = sys.argv[1] 46 | parts = title.split(" ") 47 | branch = parts[1] 48 | module = parts[2] 49 | version = branch2version(branch) 50 | from_version = get_prev_version(branch) 51 | branch_tags = ":{}::{}:".format(TAGS[version[0]], TAGS[version[1]]) 52 | from_branch_tags = ":{}::{}:".format(TAGS[from_version[0]], TAGS[from_version[1]]) 53 | set_github_var("PORT_FROM_BRANCH", from_version) 54 | set_github_var("PORT_TO_BRANCH", branch) 55 | set_github_var("PORT_TO_BRANCH_TAGS", branch_tags) 56 | set_github_var("PORT_FROM_BRANCH_TAGS", from_branch_tags) 57 | set_github_var("PORT_MODULE", module) 58 | -------------------------------------------------------------------------------- /workflow-files/branch2odoo_version.py: -------------------------------------------------------------------------------- 1 | # reads branch name from input 2 | # prints odoo version to output 3 | import fileinput 4 | 5 | ODOO_VERSIONS = [ 6 | "master", 7 | "16.0", 8 | "15.0", 9 | "14.0", 10 | "13.0", 11 | "12.0", 12 | "11.0", 13 | "10.0", 14 | "9.0", 15 | "8.0", 16 | "7.0", 17 | ] 18 | 19 | 20 | def branch2version(branch): 21 | branch = branch.rstrip() 22 | if branch in ODOO_VERSIONS: 23 | return branch 24 | 25 | for v in ODOO_VERSIONS: 26 | if branch.startswith("%s-" % v): 27 | return v 28 | 29 | return ODOO_VERSIONS[0] 30 | 31 | 32 | if __name__ == "__main__": 33 | for line in fileinput.input(): 34 | version = branch2version(line) 35 | print(version) 36 | break 37 | -------------------------------------------------------------------------------- /workflow-files/configure-docker.sh: -------------------------------------------------------------------------------- 1 | set -ex 2 | DIR="`dirname \"$0\"`" 3 | 4 | REF=${GITHUB_BASE_REF:-${GITHUB_REF}} 5 | BRANCH=${REF##*/} 6 | REPO_NAME=${GITHUB_REPOSITORY##*/} 7 | IMAGE_DB=${GITHUB_REPOSITORY_OWNER}/dinar:$REPO_NAME-db-$BRANCH 8 | IMAGE_ODOO=${GITHUB_REPOSITORY_OWNER}/dinar:$REPO_NAME-odoo-$BRANCH 9 | IMAGE_ODOO_BASE=$IMAGE_ODOO-base 10 | REGISTRY=ghcr.io 11 | REGISTRY_USERNAME="${GITHUB_ACTOR}" 12 | REGISTRY_PASSWORD="$1" 13 | 14 | ODOO_VERSION="$(echo $BRANCH | python $DIR/branch2odoo_version.py)" 15 | echo "ODOO_VERSION=$ODOO_VERSION" 16 | 17 | echo "DB_VERSION=10" >> $GITHUB_ENV 18 | echo "ODOO_VERSION=$ODOO_VERSION" >> $GITHUB_ENV 19 | echo "IMAGE_DB=$IMAGE_DB" >> $GITHUB_ENV 20 | echo "IMAGE_ODOO=$IMAGE_ODOO" >> $GITHUB_ENV 21 | echo "IMAGE_ODOO_BASE=$IMAGE_ODOO_BASE" >> $GITHUB_ENV 22 | echo "REGISTRY=${REGISTRY}" >> $GITHUB_ENV 23 | echo "REGISTRY_USERNAME=${REGISTRY_USERNAME}" >> $GITHUB_ENV 24 | echo "REGISTRY_PASSWORD=${REGISTRY_PASSWORD}" >> $GITHUB_ENV 25 | 26 | # authenticate 27 | if [ ! -z "$REGISTRY_PASSWORD" ]; then 28 | echo "$REGISTRY_PASSWORD" | docker login -u "$REGISTRY_USERNAME" --password-stdin "$REGISTRY" 29 | fi 30 | -------------------------------------------------------------------------------- /workflow-files/docker-compose-DINAR-pr.yml: -------------------------------------------------------------------------------- 1 | version: "2.4" 2 | services: 3 | odoo: 4 | image: $REGISTRY/$IMAGE_ODOO 5 | environment: 6 | PGDATABASE: &dbname DINAR 7 | PGUSER: &dbuser "odoo" 8 | DB_FILTER: ".*" 9 | PROXY_MODE: "$ODOO_PROXY_MODE" 10 | LIST_DB: "true" 11 | PTVSD_ENABLE: "${DOODBA_PTVSD_ENABLE:-0}" 12 | PYTHONOPTIMIZE: "" 13 | PYTHONPATH: /opt/odoo/custom/src/odoo 14 | SMTP_PORT: "1025" 15 | WITHOUT_DEMO: "${DOODBA_WITHOUT_DEMO-false}" 16 | WAIT_DB: "true" 17 | hostname: "$SMTP_REAL_NON_CANONICAL_DEFAULT" 18 | tty: true 19 | depends_on: 20 | - db 21 | volumes: 22 | - $PR_FILES:/opt/odoo/custom/src/private/ 23 | labels: 24 | - "dinar.odoo.modules.extra=$MODULES" 25 | command: > 26 | odoo 27 | --limit-memory-soft=0 28 | --limit-time-real-cron=9999999 29 | --limit-time-real=9999999 30 | --workers=0 31 | --init=$MODULES 32 | --load=$LOAD_MODULES 33 | --stop-after-init 34 | $ODOO_EXTRA_ARG 35 | db: 36 | image: $REGISTRY/$IMAGE_DB 37 | shm_size: 512mb 38 | environment: 39 | POSTGRES_DB: *dbname 40 | POSTGRES_USER: *dbuser 41 | POSTGRES_PASSWORD: odoopassword 42 | CONF_EXTRA: | 43 | work_mem = 32MB 44 | -------------------------------------------------------------------------------- /workflow-files/docker-compose-DINAR.yml: -------------------------------------------------------------------------------- 1 | version: "2.4" 2 | services: 3 | odoo: 4 | image: $REGISTRY/$IMAGE_ODOO_BASE 5 | environment: 6 | PGDATABASE: &dbname DINAR 7 | PGUSER: &dbuser "odoo" 8 | DB_FILTER: ".*" 9 | PROXY_MODE: "$ODOO_PROXY_MODE" 10 | LIST_DB: "true" 11 | PTVSD_ENABLE: "${DOODBA_PTVSD_ENABLE:-0}" 12 | PYTHONOPTIMIZE: "" 13 | PYTHONPATH: /opt/odoo/custom/src/odoo 14 | SMTP_PORT: "1025" 15 | WITHOUT_DEMO: "${DOODBA_WITHOUT_DEMO-false}" 16 | WAIT_DB: "true" 17 | hostname: "$SMTP_REAL_NON_CANONICAL_DEFAULT" 18 | tty: true 19 | depends_on: 20 | - db 21 | labels: 22 | - "dinar.odoo.modules=$MODULES" 23 | command: > 24 | odoo 25 | --limit-memory-soft=0 26 | --limit-time-real-cron=9999999 27 | --limit-time-real=9999999 28 | --workers=0 29 | --init=$MODULES 30 | --stop-after-init 31 | 32 | db: 33 | image: ghcr.io/itpp-labs/docker-postgres-autoconf:${DB_VERSION}-alpine 34 | shm_size: 512mb 35 | environment: 36 | POSTGRES_DB: *dbname 37 | POSTGRES_USER: *dbuser 38 | POSTGRES_PASSWORD: odoopassword 39 | CONF_EXTRA: | 40 | work_mem = 32MB 41 | -------------------------------------------------------------------------------- /workflow-files/fork2repos.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 IT Projects Labs 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import json 15 | import os 16 | import os.path 17 | import sys 18 | 19 | import yaml 20 | from oca_dependencies2configs import ( # TODO: make a python package, say dinarlib, to use local imports 21 | main as oca_deps2configs, 22 | ) 23 | from plumbum import FG 24 | from plumbum.cmd import cp, git, mkdir 25 | 26 | # TODO: update link to fork 27 | COMMIT_MESSAGE = """:construction_worker_man: sync DINAR 28 | 29 | Pushed from https://github.com/itpp-labs/DINAR/.github/workflows/fork2repos.yml 30 | """ 31 | FORK_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) 32 | 33 | 34 | def main(config, bot_token, bot_name, bot_email): 35 | print("Config:\n") 36 | print(json.dumps(config, indent=4, sort_keys=True)) 37 | cmd(git["config", "--global", "user.name", bot_name]) 38 | cmd(git["config", "--global", "user.email", bot_email]) 39 | 40 | mkdir["-p", "REPOS"] & FG 41 | branches = config["branches"] 42 | for repo in config["repos"]: 43 | for br in branches: 44 | sync_repo(repo, br, bot_token) 45 | 46 | 47 | def sync_repo(repo, br, bot_token): 48 | repo_path = os.path.join("REPOS", repo) 49 | repo_owner, repo_name = repo.split("/") 50 | mkdir["-p", repo_path] & FG 51 | if dir_is_empty(repo_path): 52 | cmd( 53 | git[ 54 | "clone", 55 | "--branch", 56 | br, 57 | "https://{}@github.com/{}/{}.git".format( 58 | bot_token, repo_owner, repo_name 59 | ), 60 | repo_path, # where to clone 61 | ] 62 | ) 63 | else: 64 | try: 65 | cmd(git["-C", repo_path, "checkout", "-b", br, "origin/%s" % br]) 66 | except Exception: 67 | # no such branch 68 | return 69 | 70 | # STATIC FILES 71 | static_files_path = os.path.join(FORK_PATH, "static-files") 72 | cmd(cp["-rTv", os.path.join(static_files_path, "all"), repo_path]) 73 | cmd(cp["-rTv", os.path.join(static_files_path, br), repo_path]) 74 | 75 | # EDITABLE FILES 76 | editable_files_path = os.path.join(FORK_PATH, "editable-files") 77 | mkdir["-p", os.path.join(repo_path, ".DINAR/image/dependencies/")] & FG 78 | # copy requirements.txt 79 | cmd( 80 | cp[ 81 | "-n", 82 | os.path.join(repo_path, "requirements.txt"), 83 | os.path.join(repo_path, ".DINAR/image/dependencies/pip.txt"), 84 | ], 85 | ignore_errors=True, 86 | ) 87 | # check if oca_dependencies file is not converted to addons.yaml yet 88 | oca_dependencies_txt = os.path.join(repo_path, "oca_dependencies.txt") 89 | addons_yaml = os.path.join(repo_path, ".DINAR/image/src/addons.yaml") 90 | repos_yaml = os.path.join(repo_path, ".DINAR/image/src/repos.yaml") 91 | run_oca2configs = os.path.exists(oca_dependencies_txt) and not os.path.exists( 92 | addons_yaml 93 | ) 94 | # copy other files 95 | cmd(cp["-rnTv", editable_files_path, repo_path]) 96 | if run_oca2configs: 97 | # make addons.yaml from oca_dependencies.txt 98 | oca_deps2configs(oca_dependencies_txt, addons_yaml, repos_yaml) 99 | 100 | # COMMIT 101 | cmd(git["-C", repo_path, "add", "--all"]) 102 | try: 103 | cmd(git["-C", repo_path, "commit", "-m", COMMIT_MESSAGE]) 104 | except Exception as e: 105 | # nothing to commit (?) 106 | print(e) 107 | return 108 | cmd(git["-C", repo_path, "push"]) 109 | 110 | 111 | def dir_is_empty(path): 112 | return len(os.listdir(path)) == 0 113 | 114 | 115 | def cmd(command, ignore_errors=False): 116 | print(command) 117 | try: 118 | print(command()) 119 | except Exception: 120 | if not ignore_errors: 121 | raise 122 | 123 | 124 | if __name__ == "__main__": 125 | config_filename = sys.argv[1] 126 | bot_token = sys.argv[2] 127 | bot_name = sys.argv[3] or "Github Actions" 128 | bot_email = sys.argv[4] or "actions@github.com" 129 | with open(config_filename) as config_file: 130 | config = yaml.safe_load(config_file) 131 | main(config, bot_token, bot_name, bot_email) 132 | -------------------------------------------------------------------------------- /workflow-files/how-to-run-locally.sh: -------------------------------------------------------------------------------- 1 | GITHUB_TOKEN=$1 2 | 3 | cat << EOF 4 | 5 | # Once per device make access token with "read:packages, repo" access 6 | # https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line 7 | 8 | USERNAME=YOUR_USERNAME_HERE 9 | TOKEN=YOUR_TOKEN_HERE 10 | # Authentication for docker packages access ("docker pull" command): 11 | docker login docker.pkg.github.com -u \$USERNAME -p \$TOKEN 12 | 13 | # Authentication for api access (it's used to get artifact url) 14 | (test ! -f \$HOME/.netrc || test ! -z "\$(grep -L 'api.github.com' \$HOME/.netrc)" ) && cat <<- EOOF >> \$HOME/.netrc 15 | machine api.github.com 16 | login \$USERNAME 17 | password \$TOKEN 18 | 19 | EOOF 20 | chmod 600 \$HOME/.netrc 21 | # Check the authentication with the following command: 22 | curl --netrc https://api.github.com/user 23 | # (If it doesn't work check your ~/.netrc file) 24 | 25 | # To try updates execute: 26 | 27 | WORKDIR=/tmp/DINAR/$GITHUB_REPOSITORY-$PR_NUM/ 28 | mkdir -p \$WORKDIR 29 | cd \$WORKDIR 30 | curl https://raw.githubusercontent.com/$DINAR_REPO/master/workflow-files/docker-compose-DINAR-pr.yml > docker-compose.yml 31 | curl https://raw.githubusercontent.com/$DINAR_REPO/master/local-files/docker-compose.override.yml > docker-compose.override.yml 32 | export REGISTRY=docker.pkg.github.com REPOSITORY=$GITHUB_REPOSITORY VERSION=$VERSION IMAGE_ODOO=$IMAGE_ODOO IMAGE_DB=$IMAGE_DB 33 | git clone --depth=1 --branch \$VERSION git@github.com:$GITHUB_REPOSITORY pr-files 34 | # Version in PR 35 | REVISION=$REVISION_PR 36 | # Version after merging 37 | REVISION=pull/$PR_NUM/merge 38 | git -C pr-files fetch origin \$REVISION 39 | git -C pr-files checkout FETCH_HEAD 40 | docker compose pull 41 | export PR_FILES=./pr-files/ 42 | export MODULES=$MODULES 43 | export LOAD_MODULES=$LOAD_MODULES 44 | export ODOO_EXTRA_ARG=$ODOO_EXTRA_ARG 45 | EOF 46 | 47 | if [ "$ARTIFACT" != "empty" ]; then 48 | 49 | cat << EOF 50 | 51 | # get artifact URL 52 | API_URL="https://api.github.com/repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/artifacts" 53 | API_RESPONSE=\$(curl --netrc -s \$API_URL) 54 | ARTIFACT_URL=\$(echo \$API_RESPONSE | \ 55 | jq --raw-output '.artifacts[] | select(.name == "new-deps") | .archive_download_url') 56 | 57 | # download artifact 58 | curl --location --netrc \$ARTIFACT_URL > new-deps.zip 59 | # unpack 60 | mkdir new-deps 61 | unzip new-deps.zip -d new-deps 62 | # download script 63 | DINAR_REPO="$DINAR_REPO" 64 | curl https://raw.githubusercontent.com/\$DINAR_REPO/master/workflow-files/load-docker-layers.sh > load-docker-layers.sh 65 | # apply script 66 | export PROJECT_NAME=\$(basename \$(pwd)) 67 | docker compose up --no-start 68 | bash load-docker-layers.sh new-deps/ 69 | 70 | EOF 71 | else 72 | 73 | cat << 'EOF' 74 | docker compose up --no-start 75 | EOF 76 | 77 | fi 78 | 79 | 80 | if [ "$VERSION" == "10.0" ]; then 81 | cat << 'EOF' 82 | 83 | # workaround for odoo 10.0 84 | docker compose start odoo 85 | docker compose exec odoo click-odoo -i 86 | # EXEC: 87 | # env['ir.module.module'].update_list() 88 | # env.cr.commit() 89 | # exit() 90 | 91 | EOF 92 | 93 | fi 94 | 95 | cat << 'EOF' 96 | docker compose start && docker compose logs --follow odoo 97 | EOF 98 | -------------------------------------------------------------------------------- /workflow-files/images-with-preinstalled-modules.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2020,2025 IT Projects Labs 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | set -ex 15 | DIR="`dirname \"$0\"`" 16 | IMAGE_DB=$1 17 | IMAGE_ODOO=$2 18 | docker compose -p dinar -f $DIR/docker-compose-DINAR.yml config 19 | docker compose -p dinar -f $DIR/docker-compose-DINAR.yml up --abort-on-container-exit 20 | 21 | docker commit $(docker inspect --format="{{.Id}}" dinar-db-1) $REGISTRY/$IMAGE_DB 22 | docker commit $(docker inspect --format="{{.Id}}" dinar-odoo-1) $REGISTRY/$IMAGE_ODOO 23 | 24 | docker push $REGISTRY/$IMAGE_DB 25 | docker push $REGISTRY/$IMAGE_ODOO 26 | 27 | docker compose -p dinar -f $DIR/docker-compose-DINAR.yml down 28 | -------------------------------------------------------------------------------- /workflow-files/load-docker-layers.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2020 IT Projects Labs 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | set -ex 15 | SHARE=$1 16 | PROJECT_NAME=${PROJECT_NAME:-dinar} 17 | 18 | for NAME in db odoo 19 | do 20 | CONTAINER=${PROJECT_NAME}-${NAME}-1 21 | LAYER=$SHARE/${NAME}-layer.tar 22 | DIFF_FILE=$SHARE/${NAME}-diff.txt 23 | LAYER_FILES=${NAME}-layer/ 24 | mkdir -p $LAYER_FILES 25 | tar -C $LAYER_FILES -xf $LAYER 26 | if grep "^D " ${DIFF_FILE}; then 27 | # TODO: remove files before the container is started. 28 | # It can be done with adding additional entrypoint script, which check env variable to delete file. 29 | # Otherwise postges files can be inconsistent 30 | docker start $CONTAINER 31 | docker exec $CONTAINER rm -rfv $(awk -F' ' '{if ($1 == "D") print $2; }' ${DIFF_FILE}) 32 | docker stop $CONTAINER 33 | fi 34 | # "docker cp -a" doesn't work due to this bug https://github.com/moby/moby/issues/34142 35 | docker cp $LAYER_FILES/. $CONTAINER:/ 36 | done 37 | -------------------------------------------------------------------------------- /workflow-files/oca_dependencies2configs.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 IT Projects Labs 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | # Reads oca_dependencies.txt file and writes addons.yaml and optionally repos.yaml 17 | # 18 | # for oca_dependencies.txt format see https://github.com/OCA/maintainer-quality-tools/blob/master/travis/clone_oca_dependencies 19 | # 20 | # TODO: it doesn't support recursive generation of dependencies 21 | 22 | import sys 23 | 24 | 25 | def parse_depfile(depfile): 26 | deps = [] 27 | for line in depfile: 28 | line = line.strip() 29 | if not line or line.startswith("#"): 30 | continue 31 | parts = line.split() 32 | num_parts = len(parts) 33 | repo, url, branch, commit = [num_parts > i and parts[i] for i in range(4)] 34 | deps.append((repo, url, branch, commit)) 35 | return deps 36 | 37 | 38 | def addons_config(repo, url=None, branch=None): 39 | # works after merging https://github.com/Tecnativa/doodba/pull/261/files 40 | pattern_line = "" 41 | if url: 42 | parts = url.split("/") 43 | pattern = "%s/{}.git" % "/".join(parts[:-1]) 44 | pattern_line = " DEFAULT_REPO_PATTERN: %s\n" % pattern 45 | 46 | # Note: this will not work if the repo name is already occupied 47 | # The solution could be moving such repositories to repos.yaml 48 | repo = parts[-1] 49 | if repo.endswith(".git"): 50 | repo = repo.split(".git")[0] 51 | else: 52 | # TODO 53 | # Temporary workaround for it-projects-llc repositories 54 | # Should be deleted on making the tool public 55 | pattern = "https://github.com/it-projects-llc/{}.git" 56 | pattern_line = " DEFAULT_REPO_PATTERN: %s\n" % pattern 57 | 58 | branch_line = "" 59 | if branch: 60 | branch_line = " ODOO_VERSION: %s\n" % branch 61 | ENV = "ENV:\n" if pattern_line or branch_line else "" 62 | return """ 63 | --- 64 | {}{}{} 65 | {}: 66 | - "*" 67 | """.format( 68 | ENV, pattern_line, branch_line, repo 69 | ) 70 | 71 | 72 | def repos_config(repo, url, branch, commit): 73 | if not url: 74 | # TODO: change to OCA once we make the tool available publicly 75 | # url = 'https://github.com/OCA/%s.git' % repo 76 | url = "https://github.com/it-projects-llc/%s.git" % repo 77 | 78 | if not url.endswith(".git"): 79 | url += ".git" 80 | 81 | if not branch: 82 | branch = "$ODOO_VERSION" 83 | 84 | commit_line = "" 85 | if commit: 86 | commit_line = "\n - origin %s" % commit 87 | 88 | return """ 89 | --- 90 | {repo}: 91 | defaults: 92 | depth: $DEPTH_MERGE 93 | remotes: 94 | origin: {origin} 95 | target: origin {branch} 96 | merges: 97 | - origin {branch}{commit_line} 98 | """.format( 99 | repo=repo, origin=url, branch=branch, commit_line=commit_line 100 | ) 101 | 102 | 103 | def deps2configs(deps): 104 | addons = "" 105 | repos = "" 106 | for repo, url, branch, commit in deps: 107 | if commit: 108 | repos += repos_config(repo, url, branch, commit) 109 | addons += addons_config(repo) 110 | else: 111 | addons += addons_config(repo, url, branch) 112 | return addons, repos 113 | 114 | 115 | def main(depfilename, addons_filename, repos_filename): 116 | with open(depfilename) as depfile: 117 | deps = parse_depfile(depfile) 118 | addons, repos = deps2configs(deps) 119 | for content, filename in [(addons, addons_filename), (repos, repos_filename)]: 120 | if content: 121 | with open(filename, "a+") as f: 122 | f.write(content) 123 | 124 | 125 | if __name__ == "__main__": 126 | depfilename = sys.argv[1] 127 | addons_filename = sys.argv[2] 128 | repos_filename = sys.argv[3] 129 | main(depfilename, addons_filename, repos_filename) 130 | -------------------------------------------------------------------------------- /workflow-files/odoo-module-migrator-mix.yml: -------------------------------------------------------------------------------- 1 | ./odoo-module-migrator: 2 | remotes: 3 | oca: https://github.com/OCA/odoo-module-migrator.git 4 | itpp-labs: https://github.com/itpp-labs/odoo-module-migrator.git 5 | merges: 6 | - oca master 7 | #- oca refs/pull/12345/head 8 | - itpp-labs change-odoo-version-only-2024 9 | target: oca master 10 | -------------------------------------------------------------------------------- /workflow-files/save-docker-layers.sh: -------------------------------------------------------------------------------- 1 | # Copyright 2020 IT Projects Labs 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | set -ex 15 | SHARE=$1 16 | mkdir -p $SHARE 17 | 18 | for NAME in db odoo 19 | do 20 | CONTAINER=$(docker inspect --format="{{.Id}}" dinar-${NAME}-1) 21 | docker commit $CONTAINER ${NAME}-image 22 | TMP=${NAME}-image.save/ 23 | mkdir $TMP 24 | docker save ${NAME}-image | tar -C $TMP -xf - 25 | LAYER=$TMP/$(jq '.[0].Layers[-1]' $TMP/manifest.json --raw-output) 26 | cp $LAYER $SHARE/${NAME}-layer.tar 27 | docker diff $CONTAINER > $SHARE/${NAME}-diff.txt 28 | done 29 | --------------------------------------------------------------------------------