├── .DINAR ├── build-date.txt ├── config.yaml └── image │ ├── README.md │ ├── dependencies │ └── pip.txt │ └── src │ ├── addons.yaml │ └── repos.yaml ├── .editorconfig ├── .eslintrc.yml ├── .flake8 ├── .github ├── FUNDING.yml └── workflows │ ├── DINAR-PORT.yml │ ├── DINAR-pr.yml │ ├── DINAR-readme.yml │ ├── DINAR.yml │ ├── main.yml │ └── repo2store.yml ├── .isort.cfg ├── .pre-commit-config.yaml ├── .prettierrc.yml ├── .pylintrc ├── .pylintrc-mandatory ├── README.md ├── setup ├── .setuptools-odoo-make-default-ignore ├── README ├── web_login_background │ ├── odoo │ │ └── addons │ │ │ └── web_login_background │ └── setup.py ├── website_login_background │ ├── odoo │ │ └── addons │ │ │ └── website_login_background │ └── setup.py ├── website_seo_url │ ├── odoo │ │ └── addons │ │ │ └── website_seo_url │ └── setup.py └── website_seo_url_product │ ├── odoo │ └── addons │ │ └── website_seo_url_product │ └── setup.py ├── web_login_background ├── README.rst ├── __init__.py ├── __manifest__.py ├── controllers.py ├── demo │ └── demo.xml ├── doc │ ├── changelog.rst │ └── index.rst ├── i18n │ └── web_login_background.pot ├── images │ └── login.png ├── models.py ├── static │ ├── css │ │ └── login.css │ ├── description │ │ ├── adaptive.png │ │ ├── attachment1.png │ │ ├── attachment2.png │ │ ├── background.png │ │ ├── background2.png │ │ ├── icon.png │ │ └── index.html │ └── img │ │ └── demo.jpg ├── templates.xml ├── tests │ ├── __init__.py │ └── test_open_url.py └── views │ └── attachment.xml ├── website_login_background ├── README.rst ├── __init__.py ├── __manifest__.py ├── demo │ └── demo.xml ├── description ├── doc │ ├── changelog.rst │ └── index.rst ├── i18n │ └── website_login_background.pot ├── images │ └── 5.png ├── models │ ├── __init__.py │ └── models.py ├── static │ ├── description │ │ ├── 1.png │ │ ├── 2.png │ │ ├── 3.png │ │ ├── icon.png │ │ └── index.html │ └── src │ │ ├── css │ │ └── login.css │ │ └── js │ │ ├── login.js │ │ └── website_login_background_tour.js ├── templates.xml └── tests │ ├── __init__.py │ └── test_background.py ├── website_seo_url ├── README.rst ├── __init__.py ├── __manifest__.py ├── doc │ ├── changelog.rst │ └── index.rst ├── i18n │ └── website_seo_url.pot ├── ir_http.py ├── models.py ├── static │ └── description │ │ └── icon.png └── tests │ └── __init__.py └── website_seo_url_product ├── README.rst ├── __init__.py ├── __manifest__.py ├── doc ├── changelog.rst └── index.rst ├── i18n └── website_seo_url_product.pot ├── models.py ├── static └── description │ ├── icon.png │ ├── index.html │ ├── product-form.png │ └── shop.png ├── tests ├── __init__.py └── test_main.py └── views.xml /.DINAR/build-date.txt: -------------------------------------------------------------------------------- 1 | new repo readme files 2 | -------------------------------------------------------------------------------- /.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 | 13 | repo_readme: 14 | addons: 15 | - portal_debranding 16 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.DINAR/image/dependencies/pip.txt: -------------------------------------------------------------------------------- 1 | # Python dependencies 2 | -------------------------------------------------------------------------------- /.DINAR/image/src/addons.yaml: -------------------------------------------------------------------------------- 1 | # see https://github.com/Tecnativa/doodba#optodoocustomsrcaddonsyaml 2 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.eslintrc.yml: -------------------------------------------------------------------------------- 1 | env: 2 | browser: true 3 | 4 | # See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449 5 | parserOptions: 6 | ecmaVersion: 2017 7 | 8 | # Globals available in Odoo that shouldn't produce errorings 9 | globals: 10 | _: readonly 11 | $: readonly 12 | fuzzy: readonly 13 | jQuery: readonly 14 | moment: readonly 15 | odoo: readonly 16 | openerp: readonly 17 | Promise: readonly 18 | owl: readonly 19 | 20 | # Styling is handled by Prettier, so we only need to enable AST rules; 21 | # see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890 22 | rules: 23 | accessor-pairs: warn 24 | array-callback-return: warn 25 | callback-return: warn 26 | capitalized-comments: 27 | - warn 28 | - always 29 | - ignoreConsecutiveComments: true 30 | ignoreInlineComments: true 31 | complexity: 32 | - warn 33 | - 15 34 | constructor-super: warn 35 | dot-notation: warn 36 | eqeqeq: warn 37 | global-require: warn 38 | handle-callback-err: warn 39 | id-blacklist: warn 40 | id-match: warn 41 | init-declarations: error 42 | max-depth: warn 43 | max-nested-callbacks: warn 44 | max-statements-per-line: warn 45 | no-alert: warn 46 | no-array-constructor: warn 47 | no-caller: warn 48 | no-case-declarations: warn 49 | no-class-assign: warn 50 | no-cond-assign: error 51 | no-const-assign: error 52 | no-constant-condition: warn 53 | no-control-regex: warn 54 | no-debugger: error 55 | no-delete-var: warn 56 | no-div-regex: warn 57 | no-dupe-args: error 58 | no-dupe-class-members: error 59 | no-dupe-keys: error 60 | no-duplicate-case: error 61 | no-duplicate-imports: error 62 | no-else-return: warn 63 | no-empty-character-class: warn 64 | no-empty-function: error 65 | no-empty-pattern: error 66 | no-empty: warn 67 | no-eq-null: error 68 | no-eval: error 69 | no-ex-assign: error 70 | no-extend-native: warn 71 | no-extra-bind: warn 72 | no-extra-boolean-cast: warn 73 | no-extra-label: warn 74 | no-fallthrough: warn 75 | no-func-assign: error 76 | no-global-assign: error 77 | no-implicit-coercion: 78 | - warn 79 | - allow: ["~"] 80 | no-implicit-globals: warn 81 | no-implied-eval: warn 82 | no-inline-comments: warn 83 | no-inner-declarations: warn 84 | no-invalid-regexp: warn 85 | no-irregular-whitespace: warn 86 | no-iterator: warn 87 | no-label-var: warn 88 | no-labels: warn 89 | no-lone-blocks: warn 90 | no-lonely-if: error 91 | no-mixed-requires: error 92 | no-multi-str: warn 93 | no-native-reassign: error 94 | no-negated-condition: warn 95 | no-negated-in-lhs: error 96 | no-new-func: warn 97 | no-new-object: warn 98 | no-new-require: warn 99 | no-new-symbol: warn 100 | no-new-wrappers: warn 101 | no-new: warn 102 | no-obj-calls: warn 103 | no-octal-escape: warn 104 | no-octal: warn 105 | no-param-reassign: off 106 | no-path-concat: warn 107 | no-process-env: warn 108 | no-process-exit: warn 109 | no-proto: warn 110 | no-prototype-builtins: warn 111 | no-redeclare: warn 112 | no-regex-spaces: warn 113 | no-restricted-globals: warn 114 | no-restricted-imports: warn 115 | no-restricted-modules: warn 116 | no-restricted-syntax: warn 117 | no-return-assign: error 118 | no-script-url: warn 119 | no-self-assign: warn 120 | no-self-compare: warn 121 | no-sequences: warn 122 | no-shadow-restricted-names: warn 123 | no-shadow: warn 124 | no-sparse-arrays: warn 125 | no-sync: warn 126 | no-this-before-super: warn 127 | no-throw-literal: warn 128 | no-undef-init: warn 129 | no-undef: error 130 | no-unmodified-loop-condition: warn 131 | no-unneeded-ternary: error 132 | no-unreachable: error 133 | no-unsafe-finally: error 134 | no-unused-expressions: error 135 | no-unused-labels: error 136 | no-unused-vars: 137 | - error 138 | - args: none 139 | no-use-before-define: error 140 | no-useless-call: warn 141 | no-useless-computed-key: warn 142 | no-useless-concat: warn 143 | no-useless-constructor: warn 144 | no-useless-escape: warn 145 | no-useless-rename: warn 146 | no-void: warn 147 | no-with: warn 148 | operator-assignment: [error, always] 149 | prefer-const: warn 150 | radix: warn 151 | require-yield: warn 152 | sort-imports: warn 153 | spaced-comment: [error, always] 154 | space-before-function-paren: ["warn", {"anonymous": "always", "named": "never"}] 155 | strict: [error, function] 156 | use-isnan: error 157 | valid-jsdoc: 158 | - warn 159 | - prefer: 160 | arg: param 161 | argument: param 162 | augments: extends 163 | constructor: class 164 | exception: throws 165 | func: function 166 | method: function 167 | prop: property 168 | return: returns 169 | virtual: abstract 170 | yield: yields 171 | preferType: 172 | array: Array 173 | bool: Boolean 174 | boolean: Boolean 175 | number: Number 176 | object: Object 177 | str: String 178 | string: String 179 | requireParamDescription: false 180 | requireReturn: false 181 | requireReturnDescription: false 182 | requireReturnType: false 183 | valid-typeof: warn 184 | yoda: warn 185 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: itprojectsllc # This is supposed to bring some coffee for us 2 | patreon: itpp # become our patron 3 | -------------------------------------------------------------------------------- /.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-fork 38 | ref: master 39 | - uses: actions/setup-python@v2 40 | with: 41 | python-version: "3.7.x" 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@v1 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 | 78 | # just copy source 79 | git checkout origin/${{ env.PORT_FROM_BRANCH }} -- ${{ env.PORT_MODULE }} 80 | git commit -m ":tada:${{ env.PORT_FROM_BRANCH_TAGS }} ${{ env.PORT_MODULE }} 81 | previous commits history: https://github.com/${{ github.repository }}/commits/${{ env.PORT_FROM_BRANCH }}/${{ env.PORT_MODULE }} 82 | 83 | > Made via .github/workflows/DINAR-PORT.yml" 84 | fi 85 | fi 86 | - name: make OCA/odoo-module-migrator 87 | run: | 88 | gitaggregate -c DINAR/workflow-files/odoo-module-migrator-mix.yml 89 | pip install -e ./odoo-module-migrator 90 | - name: apply OCA/odoo-module-migrator 91 | run: | 92 | LOG_FILE=../odoo-module-migrator.logs 93 | cd REPO 94 | odoo-module-migrate \ 95 | --modules ${{ env.PORT_MODULE }} \ 96 | --init-version-name ${{ env.PORT_FROM_BRANCH }} \ 97 | --target-version-name ${{ env.PORT_TO_BRANCH }} \ 98 | --no-commit \ 99 | --no-pre-commit \ 100 | 2> $LOG_FILE || true 101 | cat $LOG_FILE 102 | 103 | # remove colors 104 | sed -r -i "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" $LOG_FILE 105 | # escape character 106 | # TODO: update KeisukeYamashita/create-comment to support reading comment's body from file 107 | echo 'MIGRATOR_LOGS<> $GITHUB_ENV 108 | cat $LOG_FILE >> $GITHUB_ENV 109 | echo 'EOF' >> $GITHUB_ENV 110 | 111 | git add -A 112 | git commit -m ":arrow_up:${{ env.PORT_TO_BRANCH_TAGS }} OCA/odoo-module-migrator 113 | 114 | close #${{ github.event.issue.number }} 115 | 116 | > Made via .github/workflows/DINAR-PORT.yml" 117 | - name: pre-commit 118 | run: | 119 | cd REPO 120 | pre-commit run --files $(find ${{ env.PORT_MODULE }} -type f) || true 121 | git add -A 122 | git commit -m ":rainbow: pre-commit 123 | > Made via .github/workflows/DINAR-PORT.yml" || echo "pre-commit: no changes" 124 | - name: PR 125 | uses: peter-evans/create-pull-request@v3 126 | id: cpr 127 | with: 128 | path: REPO 129 | # GITHUB_TOKEN would not trigger PR checks 130 | token: ${{ secrets.DINAR_TOKEN }} 131 | branch: ${{ env.PORT_TO_BRANCH }}-${{ env.PORT_MODULE }} 132 | title: "[${{ env.PORT_TO_BRANCH }}] ${{ env.PORT_MODULE }}" 133 | body: | 134 | Made by [DINAR](https://github.com/itpp-labs/DINAR#readme) by request in #${{ github.event.issue.number }} 135 | - name: Post logs 136 | uses: KeisukeYamashita/create-comment@v1 137 | with: 138 | number: ${{ steps.cpr.outputs.pull-request-number }} 139 | comment: | 140 | [Migrator](https://github.com/OCA/odoo-module-migrator/)'s [logs](https://github.com/${{ github.repository 141 | }}/actions/runs/${{ github.run_id }}): 142 | 143 | ``` 144 | ${{ env.MIGRATOR_LOGS }} 145 | ``` 146 | -------------------------------------------------------------------------------- /.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@v1 31 | with: 32 | python-version: "3.7.x" 33 | - name: Check Python Version 34 | run: 35 | echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> 36 | $GITHUB_ENV 37 | - uses: actions/cache@v1 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-fork 56 | ref: master 57 | - uses: actions/setup-python@v1 58 | with: 59 | python-version: "3.7.x" 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-fork" 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@v1 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-fork 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@v1 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-fork 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-fork" 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 | -------------------------------------------------------------------------------- /.github/workflows/DINAR-readme.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: update repo's readme" 15 | 16 | on: 17 | push: 18 | paths: 19 | - ".DINAR/build-date.txt" 20 | - ".DINAR/config.yaml" 21 | - ".github/workflows/DINAR-readme.yml" 22 | - "*/__manifest__.py" 23 | jobs: 24 | repo_readme: 25 | runs-on: ubuntu-latest 26 | if: 27 | "! endsWith(github.repository, '-store') && startsWith(github.repository, 28 | 'itpp-labs/')" 29 | steps: 30 | - name: Checkout Repo 31 | uses: actions/checkout@v2 32 | with: 33 | path: REPO 34 | # token is required to bypass pushing without checks/reviews 35 | token: ${{ secrets.DINAR_TOKEN }} 36 | - name: Checkout DINAR 37 | uses: actions/checkout@v2 38 | with: 39 | path: DINAR 40 | repository: itpp-labs/DINAR-fork 41 | ref: master 42 | - uses: actions/setup-python@v1 43 | with: 44 | python-version: "3.7.x" 45 | - name: Install python tools 46 | run: | 47 | pip install plumbum pyyaml PyGithub 48 | - name: Generate readme 49 | run: | 50 | REF=${GITHUB_BASE_REF:-${GITHUB_REF}} 51 | BRANCH=${REF##*/} 52 | cd REPO 53 | python ../DINAR/workflow-files/generate-repo-readme.py ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} $BRANCH 54 | - name: Commit updates 55 | uses: stefanzweifel/git-auto-commit-action@v4 56 | with: 57 | repository: REPO 58 | commit_user_name: Mitchell Admin 59 | commit_user_email: itpp-bot@users.noreply.github.com 60 | # Commit may contain other updates, but in usual flow it's only module list. 61 | commit_message: | 62 | :construction_worker_man: Update module list 63 | 64 | Sent from Github Actions (see .github/workflows/DINAR-readme.yml ) 65 | -------------------------------------------------------------------------------- /.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@v2 61 | with: 62 | path: REPO 63 | - name: Checkout DINAR 64 | uses: actions/checkout@v2 65 | with: 66 | path: DINAR 67 | repository: itpp-labs/DINAR-fork 68 | ref: master 69 | - uses: actions/setup-python@v1 70 | with: 71 | python-version: "3.7.x" 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@v5 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 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Telegram Notifications 2 | 3 | on: 4 | issues: 5 | types: [opened, reopened, deleted, closed] 6 | 7 | jobs: 8 | notify: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - name: Send notifications to Telegram 13 | run: 14 | curl -s -X POST https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN 15 | }}/sendMessage -d chat_id=${{ secrets.TELEGRAM_CHAT_ID }} -d text="${MESSAGE}" 16 | >> /dev/null 17 | env: 18 | MESSAGE: 19 | "Issue ${{ github.event.action }}: \n${{ github.event.issue.html_url }}" 20 | -------------------------------------------------------------------------------- /.github/workflows/repo2store.yml: -------------------------------------------------------------------------------- 1 | name: "Push Updates to REPO-store" 2 | 3 | on: 4 | push: 5 | 6 | jobs: 7 | repo2store: 8 | runs-on: ubuntu-latest 9 | if: 10 | "! endsWith(github.repository, '-store') && startsWith(github.repository, 11 | 'itpp-labs/')" 12 | steps: 13 | - name: Checkout REPO 14 | uses: actions/checkout@v2-beta 15 | with: 16 | fetch-depth: 0 17 | # custom token is not needed for fetching REPO, 18 | # but the action makes some magic with authentication headers 19 | # which are used on pushing to REPO-store 20 | token: ${{ secrets.DINAR_TOKEN }} 21 | - name: Fetch REPO-store 22 | run: | 23 | git remote add store https://x-access-token:${{ secrets.DINAR_TOKEN }}@github.com/${GITHUB_REPOSITORY}-store.git 24 | git fetch store 25 | - name: Merge and Push 26 | run: | 27 | set -x 28 | git config --global user.email "itpp-bot@users.noreply.github.com" 29 | git config --global user.name "Mitchell Admin" 30 | BRANCH=${GITHUB_REF##*/} 31 | REF=$(git rev-parse HEAD) 32 | git checkout -b $BRANCH-store store/$BRANCH 33 | git merge origin/$BRANCH $REF 34 | git push store $BRANCH-store:$BRANCH 35 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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.4 19 | hooks: 20 | - id: autoflake 21 | args: ["-i", "--ignore-init-module-imports"] 22 | - repo: https://github.com/psf/black 23 | rev: 20.8b1 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://gitlab.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.5.1 106 | hooks: 107 | - id: isort 108 | name: isort except __init__.py 109 | args: 110 | - --settings=. 111 | exclude: /__init__\.py$ 112 | -------------------------------------------------------------------------------- /.prettierrc.yml: -------------------------------------------------------------------------------- 1 | # Defaults for all prettier-supported languages. 2 | # Prettier will complete this with settings from .editorconfig file. 3 | bracketSpacing: false 4 | printWidth: 88 5 | proseWrap: always 6 | semi: true 7 | trailingComma: "es5" 8 | xmlWhitespaceSensitivity: "ignore" 9 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![help@itpp.dev](https://itpp.dev/images/infinity-readme.png)](mailto:help@itpp.dev) 2 | # [14.0] Odoo Website Addons 3 | 4 | :open_file_folder: Get a **.zip** file with all needed dependencies: 5 | 6 | :heavy_check_mark: [portal_debranding](https://apps.odoo.com/apps/modules/14.0/portal_debranding/) 7 |
:heavy_check_mark: [web_login_background](https://apps.odoo.com/apps/modules/14.0/web_login_background/) 8 |
:heavy_check_mark: [website_login_background](https://apps.odoo.com/apps/modules/14.0/website_login_background/) 9 |
:heavy_check_mark: [website_seo_url](https://apps.odoo.com/apps/modules/14.0/website_seo_url/) 10 |
:heavy_check_mark: [website_seo_url_product](https://apps.odoo.com/apps/modules/14.0/website_seo_url_product/) 11 | 12 | :star: Star this repo if you **like** it! 13 | 14 | :heart: [Sponsor us](https://patreon.com/itpp) if you **love** it! 15 | 16 | Other Addons 17 | ============ 18 | 19 | | Repository | Versions | 20 | |------------|----------| 21 | | [itpp-labs/**pos-addons**](https://github.com/itpp-labs/pos-addons) | [[14.0]](https://github.com/itpp-labs/pos-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/pos-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/pos-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/pos-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/pos-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/pos-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/pos-addons/tree/8.0#readme) [[7.0]](https://github.com/itpp-labs/pos-addons/tree/7.0#readme) | 22 | | [itpp-labs/**mail-addons**](https://github.com/itpp-labs/mail-addons) | [[14.0]](https://github.com/itpp-labs/mail-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/mail-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/mail-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/mail-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/mail-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/mail-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/mail-addons/tree/8.0#readme) | 23 | | [itpp-labs/**misc-addons**](https://github.com/itpp-labs/misc-addons) | [[14.0]](https://github.com/itpp-labs/misc-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/misc-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/misc-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/misc-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/misc-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/misc-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/misc-addons/tree/8.0#readme) [[7.0]](https://github.com/itpp-labs/misc-addons/tree/7.0#readme) | 24 | | [itpp-labs/**sync-addons**](https://github.com/itpp-labs/sync-addons) | [[14.0]](https://github.com/itpp-labs/sync-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/sync-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/sync-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/sync-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/sync-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/sync-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/sync-addons/tree/8.0#readme) | 25 | | [itpp-labs/**access-addons**](https://github.com/itpp-labs/access-addons) | [[14.0]](https://github.com/itpp-labs/access-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/access-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/access-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/access-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/access-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/access-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/access-addons/tree/8.0#readme) | 26 | | [itpp-labs/**website-addons**](https://github.com/itpp-labs/website-addons) | [[14.0]](https://github.com/itpp-labs/website-addons/tree/14.0#readme) [[13.0]](https://github.com/itpp-labs/website-addons/tree/13.0#readme) [[12.0]](https://github.com/itpp-labs/website-addons/tree/12.0#readme) [[11.0]](https://github.com/itpp-labs/website-addons/tree/11.0#readme) [[10.0]](https://github.com/itpp-labs/website-addons/tree/10.0#readme) [[9.0]](https://github.com/itpp-labs/website-addons/tree/9.0#readme) [[8.0]](https://github.com/itpp-labs/website-addons/tree/8.0#readme) | 27 | -------------------------------------------------------------------------------- /setup/.setuptools-odoo-make-default-ignore: -------------------------------------------------------------------------------- 1 | # addons listed in this file are ignored by 2 | # setuptools-odoo-make-default (one addon per line) 3 | -------------------------------------------------------------------------------- /setup/README: -------------------------------------------------------------------------------- 1 | To learn more about this directory, please visit 2 | https://pypi.python.org/pypi/setuptools-odoo 3 | -------------------------------------------------------------------------------- /setup/web_login_background/odoo/addons/web_login_background: -------------------------------------------------------------------------------- 1 | ../../../../web_login_background -------------------------------------------------------------------------------- /setup/web_login_background/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | setuptools.setup( 4 | setup_requires=['setuptools-odoo'], 5 | odoo_addon=True, 6 | ) 7 | -------------------------------------------------------------------------------- /setup/website_login_background/odoo/addons/website_login_background: -------------------------------------------------------------------------------- 1 | ../../../../website_login_background -------------------------------------------------------------------------------- /setup/website_login_background/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | setuptools.setup( 4 | setup_requires=['setuptools-odoo'], 5 | odoo_addon=True, 6 | ) 7 | -------------------------------------------------------------------------------- /setup/website_seo_url/odoo/addons/website_seo_url: -------------------------------------------------------------------------------- 1 | ../../../../website_seo_url -------------------------------------------------------------------------------- /setup/website_seo_url/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | setuptools.setup( 4 | setup_requires=['setuptools-odoo'], 5 | odoo_addon=True, 6 | ) 7 | -------------------------------------------------------------------------------- /setup/website_seo_url_product/odoo/addons/website_seo_url_product: -------------------------------------------------------------------------------- 1 | ../../../../website_seo_url_product -------------------------------------------------------------------------------- /setup/website_seo_url_product/setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | setuptools.setup( 4 | setup_requires=['setuptools-odoo'], 5 | odoo_addon=True, 6 | ) 7 | -------------------------------------------------------------------------------- /web_login_background/README.rst: -------------------------------------------------------------------------------- 1 | .. image:: https://itpp.dev/images/infinity-readme.png 2 | :alt: Tested and maintained by IT Projects Labs 3 | :target: https://itpp.dev 4 | 5 | Web Login Background 6 | ==================== 7 | 8 | Set your background picture on odoo login and signup screens. 9 | 10 | Tested on `Odoo 14.0 `_ 11 | -------------------------------------------------------------------------------- /web_login_background/__init__.py: -------------------------------------------------------------------------------- 1 | from . import controllers 2 | from . import models 3 | -------------------------------------------------------------------------------- /web_login_background/__manifest__.py: -------------------------------------------------------------------------------- 1 | # License MIT (https://opensource.org/licenses/MIT). 2 | # Copyright 2021 Ivan Yelizariev 3 | # Copyright 2021 Denis Mudarisov 4 | 5 | { 6 | "name": """Web login background""", 7 | "summary": """Get a random background at the login page""", 8 | "category": "Extra Tools", 9 | "images": ["images/login.png"], 10 | "version": "14.0.1.0.4", 11 | "author": "IT-Projects LLC, Ildar Nasyrov, Nicolas JEUDY", 12 | "support": "help@itpp.dev", 13 | "website": "https://twitter.com/OdooFree", 14 | "license": "Other OSI approved licence", # MIT 15 | "depends": ["base"], 16 | "external_dependencies": {"python": [], "bin": []}, 17 | "data": ["templates.xml", "views/attachment.xml"], 18 | "demo": ["demo/demo.xml"], 19 | "installable": True, 20 | "auto_install": False, 21 | } 22 | -------------------------------------------------------------------------------- /web_login_background/controllers.py: -------------------------------------------------------------------------------- 1 | from odoo import http 2 | from odoo.http import request 3 | 4 | from odoo.addons.auth_signup.controllers.main import AuthSignupHome 5 | from odoo.addons.web.controllers.main import Home 6 | 7 | 8 | class Background(Home): 9 | @http.route() 10 | def web_login(self, redirect=None, **kw): 11 | picture_url = request.env["ir.attachment"].get_background_pic() 12 | if picture_url: 13 | request.params["picture_url"] = picture_url 14 | 15 | return super(Background, self).web_login(redirect=redirect, **kw) 16 | 17 | 18 | class BackgroundSignup(AuthSignupHome): 19 | @http.route("/web/signup", type="http", auth="public") 20 | def web_auth_signup(self, *args, **kw): 21 | picture_url = request.env["ir.attachment"].get_background_pic() 22 | if picture_url: 23 | request.params["picture_url"] = picture_url 24 | 25 | return super(BackgroundSignup, self).web_auth_signup(*args, **kw) 26 | -------------------------------------------------------------------------------- /web_login_background/demo/demo.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | Demo attachment picture 10 | demo.jpg 11 | True 12 | binary 13 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /web_login_background/doc/changelog.rst: -------------------------------------------------------------------------------- 1 | `1.0.4` 2 | ------- 3 | 4 | - **Fix:** support Odoo EE 5 | 6 | `1.0.3` 7 | ------- 8 | 9 | - **Improvement:** better way of obtaining the background image search domain for more convenient extension of the module 10 | 11 | `1.0.2` 12 | ------- 13 | 14 | - **Fix:** applied new CSS styles according to changes in 12 odoo 15 | - **Fix:** changed the process of getting hash for url 16 | 17 | `1.0.1` 18 | ------- 19 | 20 | - IMP: Background used on signup page too. 21 | - IMP: Round corners on form. 22 | 23 | `1.0.0` 24 | ------- 25 | 26 | - init version 27 | -------------------------------------------------------------------------------- /web_login_background/doc/index.rst: -------------------------------------------------------------------------------- 1 | ====================== 2 | Web Login Background 3 | ====================== 4 | 5 | Installation 6 | ============ 7 | 8 | * `Install `__ this module in a usual way 9 | * If you use Website app, you also need to install `website_login_background `__ 10 | 11 | Configuration 12 | ============= 13 | 14 | * `Activate Developer Mode `__ 15 | * add several images: 16 | 17 | * From menu ``[[ Settings ]] >> Technical >> Database Structure >> Attachments`` create a new image attachment 18 | * In the attachment form put a checkmarks in the "Use as login page background" and the "Is public document" checkboxes and click on ``[Save]`` button 19 | 20 | Usage 21 | ===== 22 | 23 | * Open login page ``/web/login`` 24 | * RESULT: your image is on background 25 | * Reload login page 26 | * RESULT: background is randomly changed. It works only if there are more than one background images. 27 | -------------------------------------------------------------------------------- /web_login_background/i18n/web_login_background.pot: -------------------------------------------------------------------------------- 1 | # Translation of Odoo Server. 2 | # This file contains the translation of the following modules: 3 | # * web_login_background 4 | # 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: Odoo Server 13.0\n" 8 | "Report-Msgid-Bugs-To: \n" 9 | "Last-Translator: \n" 10 | "Language-Team: \n" 11 | "MIME-Version: 1.0\n" 12 | "Content-Type: text/plain; charset=UTF-8\n" 13 | "Content-Transfer-Encoding: \n" 14 | "Plural-Forms: \n" 15 | 16 | #. module: web_login_background 17 | #: model:ir.model,name:web_login_background.model_ir_attachment 18 | msgid "Attachment" 19 | msgstr "" 20 | 21 | #. module: web_login_background 22 | #: model:ir.model.fields,field_description:web_login_background.field_ir_attachment__use_as_background 23 | msgid "Use as login page background" 24 | msgstr "" 25 | 26 | #. module: web_login_background 27 | #: model_terms:ir.ui.view,arch_db:web_login_background.web_login_background 28 | msgid "Website" 29 | msgstr "" 30 | -------------------------------------------------------------------------------- /web_login_background/images/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itpp-labs/website-addons/a8fa62bfb7a43c9e7ab0f0265b6676195716a45e/web_login_background/images/login.png -------------------------------------------------------------------------------- /web_login_background/models.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Denis Mudarisov 2 | # License MIT (https://opensource.org/licenses/MIT). 3 | import hashlib 4 | from random import choice 5 | 6 | from odoo import SUPERUSER_ID, api, fields, models 7 | from odoo.tools import pycompat 8 | 9 | 10 | def _attachment2url(att): 11 | sha = hashlib.md5(pycompat.to_text(att.datas).encode("utf-8")).hexdigest()[0:7] 12 | return "/web/image/{}-{}".format(att.id, sha) 13 | 14 | 15 | class IRAttachmentBackground(models.Model): 16 | _inherit = "ir.attachment" 17 | 18 | use_as_background = fields.Boolean( 19 | "Use as login page background", default=False, index=True 20 | ) 21 | 22 | @api.onchange("use_as_background") 23 | def _onchange_use_as_background(self): 24 | if self.use_as_background: 25 | self.public = True 26 | 27 | def _get_background_images_domain(self): 28 | return [("use_as_background", "=", True)] 29 | 30 | @api.model 31 | def get_background_pic(self): 32 | pictures = self.with_user(SUPERUSER_ID).search( 33 | self._get_background_images_domain() 34 | ) 35 | if pictures: 36 | p = choice(pictures) 37 | picture_url = p.url or _attachment2url(p) 38 | return picture_url 39 | else: 40 | return False 41 | -------------------------------------------------------------------------------- /web_login_background/static/css/login.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | .web_login_background { 3 | padding: 10px; 4 | box-sizing: border-box; 5 | } 6 | 7 | .web_login_background { 8 | box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); 9 | border-top-left-radius: 6px; 10 | border-top-right-radius: 6px; 11 | border-bottom-left-radius: 6px; 12 | border-bottom-right-radius: 6px; 13 | position: relative; 14 | background-color: #fff; 15 | -webkit-background-clip: padding-box; 16 | background-clip: padding-box; 17 | border: 1px solid #999; 18 | border: 1px solid rgba(0, 0, 0, 0.2); 19 | border-radius: 6px; 20 | outline: 0; 21 | -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); 22 | box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); 23 | width: 400px; 24 | margin: 40px auto; 25 | } 26 | 27 | .oe_signup_form { 28 | padding: 10px; 29 | } 30 | -------------------------------------------------------------------------------- /web_login_background/static/description/adaptive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itpp-labs/website-addons/a8fa62bfb7a43c9e7ab0f0265b6676195716a45e/web_login_background/static/description/adaptive.png -------------------------------------------------------------------------------- /web_login_background/static/description/attachment1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itpp-labs/website-addons/a8fa62bfb7a43c9e7ab0f0265b6676195716a45e/web_login_background/static/description/attachment1.png -------------------------------------------------------------------------------- /web_login_background/static/description/attachment2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itpp-labs/website-addons/a8fa62bfb7a43c9e7ab0f0265b6676195716a45e/web_login_background/static/description/attachment2.png -------------------------------------------------------------------------------- /web_login_background/static/description/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itpp-labs/website-addons/a8fa62bfb7a43c9e7ab0f0265b6676195716a45e/web_login_background/static/description/background.png -------------------------------------------------------------------------------- /web_login_background/static/description/background2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itpp-labs/website-addons/a8fa62bfb7a43c9e7ab0f0265b6676195716a45e/web_login_background/static/description/background2.png -------------------------------------------------------------------------------- /web_login_background/static/description/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itpp-labs/website-addons/a8fa62bfb7a43c9e7ab0f0265b6676195716a45e/web_login_background/static/description/icon.png -------------------------------------------------------------------------------- /web_login_background/static/description/index.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

Web Login Background

5 |

Get a random background at the login page.

6 |
7 |
8 |
9 | 10 |
11 |
12 |
13 |

Usage

14 |

15 | After installing the module, yon should go to Settings and create an attachment (background image) 16 |

17 |
18 | 19 |
20 |
21 | 22 |
23 |

24 | Select an image, put a checkmark in the "Use as login page background" checkbox and click on Save button 25 |

26 |
27 | 28 |
29 |
30 |
31 |
32 | 33 |
34 |
35 |
36 |

37 | Now, turning to the login page, you can see the downloaded background 38 |

39 |
40 | 41 |
42 |
43 | 44 |
45 |

46 | The module allows to use unlimited number of images for the background. In this case, an image will be selected and changed randomly. For example, if we reload the above login page, the background will be changed. 47 |

48 |
49 | 50 |
51 |
52 |
53 |
54 | 55 |
56 |
57 |
58 |

59 | It must be noted that a background images can be adapted to any size screen. 60 |

61 |
62 | 63 |
64 |
65 |
66 |
67 | 68 |
69 |
70 |
71 |

Need our service?

72 |

Contact us by email or fill out request form

73 | 79 |
80 |
81 |
82 |
97 | Tested on Odoo
13.0 community 98 |
99 | 116 |
117 |
118 |
119 |
120 | 121 | -------------------------------------------------------------------------------- /web_login_background/static/img/demo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itpp-labs/website-addons/a8fa62bfb7a43c9e7ab0f0265b6676195716a45e/web_login_background/static/img/demo.jpg -------------------------------------------------------------------------------- /web_login_background/templates.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 21 | 22 | -------------------------------------------------------------------------------- /web_login_background/tests/__init__.py: -------------------------------------------------------------------------------- 1 | from . import test_open_url 2 | -------------------------------------------------------------------------------- /web_login_background/tests/test_open_url.py: -------------------------------------------------------------------------------- 1 | import odoo.tests 2 | 3 | 4 | @odoo.tests.tagged("-at_install", "post_install") 5 | class TestUi(odoo.tests.HttpCase): 6 | def test_open_url(self): 7 | # wait till page loaded 8 | code = """ 9 | setTimeout(function () { 10 | if ($('body').css('background-image').startsWith('url')) { 11 | console.log('test successful'); 12 | } else { 13 | console.log('test failed'); 14 | } 15 | }, 3000); 16 | """ 17 | link = "/web/login" 18 | self.browser_js(link, code) 19 | -------------------------------------------------------------------------------- /web_login_background/views/attachment.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | ir.attachment 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | {'readonly': [('use_as_background', '=', True)]} 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /website_login_background/README.rst: -------------------------------------------------------------------------------- 1 | .. image:: https://itpp.dev/images/infinity-readme.png 2 | :alt: Tested and maintained by IT Projects Labs 3 | :target: https://itpp.dev 4 | 5 | ======================== 6 | Website Login Background 7 | ======================== 8 | 9 | Random background image to your taste at the website login page 10 | 11 | 12 | Further information 13 | =================== 14 | 15 | Odoo Apps Store: https://apps.odoo.com/apps/modules/14.0/website_login_background/ 16 | 17 | 18 | Tested on `Odoo 14.0 `_ 19 | -------------------------------------------------------------------------------- /website_login_background/__init__.py: -------------------------------------------------------------------------------- 1 | from . import models 2 | -------------------------------------------------------------------------------- /website_login_background/__manifest__.py: -------------------------------------------------------------------------------- 1 | { 2 | "name": """Website login background""", 3 | "summary": """Random background image to your taste at the website login page""", 4 | "category": "Website", 5 | "images": ["images/5.png"], 6 | "version": "14.0.1.0.3", 7 | "author": "IT-Projects LLC", 8 | "support": "help@itpp.dev", 9 | "website": "https://twitter.com/OdooFree", 10 | "license": "Other OSI approved licence", # MIT 11 | "depends": ["web_login_background", "website"], 12 | "external_dependencies": {"python": [], "bin": []}, 13 | "data": ["templates.xml"], 14 | "demo": ["demo/demo.xml"], 15 | "installable": True, 16 | "auto_install": True, 17 | } 18 | -------------------------------------------------------------------------------- /website_login_background/demo/demo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /website_login_background/description: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itpp-labs/website-addons/a8fa62bfb7a43c9e7ab0f0265b6676195716a45e/website_login_background/description -------------------------------------------------------------------------------- /website_login_background/doc/changelog.rst: -------------------------------------------------------------------------------- 1 | `1.0.3` 2 | ------- 3 | 4 | - **Fix:** Removed glitch, where login/signup form overlaps footer 5 | 6 | `1.0.2` 7 | ------- 8 | 9 | - **Improvement:** Display the background images for the specified websites 10 | 11 | `1.0.1` 12 | ------- 13 | 14 | - IMP: Padding for signup page 15 | 16 | `1.0.0` 17 | ------- 18 | 19 | - init version 20 | -------------------------------------------------------------------------------- /website_login_background/doc/index.rst: -------------------------------------------------------------------------------- 1 | ========================= 2 | Website Login Background 3 | ========================= 4 | 5 | Installation 6 | ============ 7 | 8 | * `Install `__ this module in a usual way 9 | 10 | 11 | Usage 12 | ===== 13 | 14 | * `Activate Developer Mode `__ 15 | * Go to Settings ``Technical >> Database Structure >> Attachments`` 16 | * Click ``[Create]`` 17 | * Upload an image file 18 | * Choose the website for which you want to set the background image or keep it empty to apply image for all websites 19 | * Mark the "Use as a login page background" box 20 | * Click ``[Save]`` 21 | * Go to your website 22 | * Open login page and see the image as a background 23 | -------------------------------------------------------------------------------- /website_login_background/i18n/website_login_background.pot: -------------------------------------------------------------------------------- 1 | # Translation of Odoo Server. 2 | # This file contains the translation of the following modules: 3 | # * website_login_background 4 | # 5 | msgid "" 6 | msgstr "" 7 | "Project-Id-Version: Odoo Server 13.0\n" 8 | "Report-Msgid-Bugs-To: \n" 9 | "Last-Translator: \n" 10 | "Language-Team: \n" 11 | "MIME-Version: 1.0\n" 12 | "Content-Type: text/plain; charset=UTF-8\n" 13 | "Content-Transfer-Encoding: \n" 14 | "Plural-Forms: \n" 15 | 16 | #. module: website_login_background 17 | #: model:ir.model,name:website_login_background.model_ir_attachment 18 | msgid "Attachment" 19 | msgstr "" 20 | -------------------------------------------------------------------------------- /website_login_background/images/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itpp-labs/website-addons/a8fa62bfb7a43c9e7ab0f0265b6676195716a45e/website_login_background/images/5.png -------------------------------------------------------------------------------- /website_login_background/models/__init__.py: -------------------------------------------------------------------------------- 1 | # License MIT (https://opensource.org/licenses/MIT). 2 | 3 | from . import models 4 | -------------------------------------------------------------------------------- /website_login_background/models/models.py: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Denis Mudarisov 2 | # License MIT (https://opensource.org/licenses/MIT). 3 | 4 | 5 | from odoo import models 6 | 7 | 8 | class IrAttachmentWebsiteBackground(models.Model): 9 | _inherit = "ir.attachment" 10 | 11 | def _get_background_images_domain(self): 12 | domain = super( 13 | IrAttachmentWebsiteBackground, self 14 | )._get_background_images_domain() 15 | current_website_id = self.env.context.get("website_id") 16 | if current_website_id: 17 | domain.append(("website_id.id", "=", current_website_id)) 18 | 19 | return domain 20 | -------------------------------------------------------------------------------- /website_login_background/static/description/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itpp-labs/website-addons/a8fa62bfb7a43c9e7ab0f0265b6676195716a45e/website_login_background/static/description/1.png -------------------------------------------------------------------------------- /website_login_background/static/description/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itpp-labs/website-addons/a8fa62bfb7a43c9e7ab0f0265b6676195716a45e/website_login_background/static/description/2.png -------------------------------------------------------------------------------- /website_login_background/static/description/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itpp-labs/website-addons/a8fa62bfb7a43c9e7ab0f0265b6676195716a45e/website_login_background/static/description/3.png -------------------------------------------------------------------------------- /website_login_background/static/description/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itpp-labs/website-addons/a8fa62bfb7a43c9e7ab0f0265b6676195716a45e/website_login_background/static/description/icon.png -------------------------------------------------------------------------------- /website_login_background/static/description/index.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

Website Login Background

5 |

Random background image to your taste at the website login page. Adapted to any size screen

6 |
7 |
8 |
9 | 10 |
11 |
12 |
13 |

Usage

14 |

15 |

  • Activate the developer mode
  • 16 |
  • Go to Settings → Technical → Database Structure → Attachments
  • 17 |
  • Click on 'Create' button
  • 18 |
  • Upload an image file
  • 19 |
  • Mark the "Use as a login page background" box and click on 'Save' button
  • 20 |

    21 |
    22 | 23 |
    24 |
    25 | 26 |
    27 |
    28 |
    29 |

    30 | Go to the login page and see the result 31 |

    32 |
    33 | 34 |
    35 |
    36 | 37 |
    38 |

    39 | You can use as many images as you want for the background. After each page refresh, there will be a new random image. 40 |

    41 |
    42 | 43 |
    44 |
    45 |
    46 |
    47 | 48 | 49 |
    50 |
    51 |
    52 |

    Need our service?

    53 |

    Contact us by email or fill out request form

    54 | 60 |
    61 |
    62 |
    63 |
    78 | Tested on Odoo
    13.0 community 79 |
    80 |
    95 | Tested on Odoo
    13.0 enterprise 96 |
    97 |
    98 |
    99 |
    100 |
    101 | -------------------------------------------------------------------------------- /website_login_background/static/src/css/login.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | main .oe_login_form { 4 | padding: 10px; 5 | margin: 0px; 6 | } 7 | 8 | main .oe_signup_form { 9 | padding: 10px; 10 | } 11 | 12 | main .oe_website_login_container { 13 | width: 300px; 14 | margin: 40px auto; 15 | } 16 | -------------------------------------------------------------------------------- /website_login_background/static/src/js/login.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | "use strict"; 3 | if ($(".oe_website_login_container").length) { 4 | var headerHeight = $("header").innerHeight(); 5 | window.scrollTo(0, headerHeight); 6 | } 7 | }); 8 | -------------------------------------------------------------------------------- /website_login_background/static/src/js/website_login_background_tour.js: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 Denis Mudarisov 2 | License MIT (https://opensource.org/licenses/MIT). */ 3 | odoo.define("website_login_background.tour", function (require) { 4 | "use strict"; 5 | 6 | var tour = require("web_tour.tour"); 7 | 8 | tour.register( 9 | "website_login_background_check", 10 | { 11 | test: true, 12 | url: "/web/login", 13 | }, 14 | [ 15 | { 16 | content: "check background", 17 | trigger: ".oe_website_login_container", 18 | run: function () { 19 | if ($("body").css("background-image") === "none") { 20 | console.log("error"); 21 | } else { 22 | console.log("ok"); 23 | } 24 | }, 25 | }, 26 | ] 27 | ); 28 | }); 29 | -------------------------------------------------------------------------------- /website_login_background/templates.xml: -------------------------------------------------------------------------------- 1 | 2 | 23 |