From d1ca93fa959b00e48efe2ae2109d153944588daa Mon Sep 17 00:00:00 2001 From: Kobby Folson Date: Mon, 8 Apr 2024 12:07:24 +0100 Subject: [PATCH 01/12] add copier template file and pre-commit config --- .copier-answers.yml | 26 ++++++++ .pre-commit-config.yaml | 127 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 .copier-answers.yml create mode 100644 .pre-commit-config.yaml diff --git a/.copier-answers.yml b/.copier-answers.yml new file mode 100644 index 0000000..9da44a6 --- /dev/null +++ b/.copier-answers.yml @@ -0,0 +1,26 @@ +# Do NOT update manually; changes here will be overwritten by Copier +_commit: v1.20 +_src_path: https://github.com/OCA/oca-addons-repo-template.git +additional_ruff_rules: [] +ci: GitHub +convert_readme_fragments_to_markdown: false +generate_requirements_txt: true +github_check_license: false +github_ci_extra_env: {} +github_enable_codecov: false +github_enable_makepot: false +github_enable_stale_action: false +github_enforce_dev_status_compatibility: false +include_wkhtmltopdf: false +odoo_test_flavor: Both +odoo_version: 15.0 +org_name: Glo Networks +org_slug: GlodoUK +rebel_module_groups: [] +repo_description: Sale addons for Odoo +repo_name: Sale addons for Odoo +repo_slug: sale +repo_website: https://github.com/GlodoUK/sale +use_pyproject_toml: false +use_ruff: true + diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..31cdacc --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,127 @@ +exclude: | + (?x) + # NOT INSTALLABLE ADDONS + # END NOT INSTALLABLE ADDONS + # Files and folders generated by bots, to avoid loops + ^setup/|/static/description/index\.html$| + # We don't want to mess with tool-generated files + .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/| + # Maybe reactivate this when all README files include prettier ignore tags? + ^README\.md$| + # Library files can have extraneous formatting (even minimized) + /static/(src/)?lib/| + # Repos using Sphinx to generate docs don't need prettying + ^docs/_templates/.*\.html$| + # Don't bother non-technical authors with formatting issues in docs + readme/.*\.(rst|md)$| + # Ignore build and dist directories in addons + /build/|/dist/| + # You don't usually want a bot to modify your legal texts + (LICENSE.*|COPYING.*) +default_language_version: + python: python3 + node: "14.18.0" +repos: + - repo: local + hooks: + # These files are most likely copier diff rejection junks; if found, + # review them manually, fix the problem (if needed) and remove them + - id: forbidden-files + name: forbidden files + entry: found forbidden files; remove them + language: fail + files: "\\.rej$" + - id: en-po-files + name: en.po files cannot exist + entry: found a en.po file + language: fail + files: '[a-zA-Z0-9_]*/i18n/en\.po$' + - repo: https://github.com/oca/maintainer-tools + rev: 9a170331575a265c092ee6b24b845ec508e8ef75 + hooks: + # update the NOT INSTALLABLE ADDONS section above + - id: oca-update-pre-commit-excluded-addons + - id: oca-fix-manifest-website + args: ["https://github.com/GlodoUK/sale"] + - id: oca-gen-addon-readme + args: + - --addons-dir=. + - --branch=15.0 + - --org-name=GlodoUK + - --repo-name=sale + - --if-source-changed + - --keep-source-digest + - repo: https://github.com/OCA/odoo-pre-commit-hooks + rev: v0.0.25 + hooks: + - id: oca-checks-odoo-module + - id: oca-checks-po + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.4.1 + hooks: + - id: prettier + name: prettier (with plugin-xml) + additional_dependencies: + - "prettier@2.4.1" + - "@prettier/plugin-xml@1.1.0" + args: + - --plugin=@prettier/plugin-xml + files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$ + - repo: https://github.com/pre-commit/mirrors-eslint + rev: v7.32.0 + hooks: + - id: eslint + verbose: true + args: + - --color + - --fix + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: trailing-whitespace + # exclude autogenerated files + exclude: /README\.rst$|\.pot?$ + - id: end-of-file-fixer + # exclude autogenerated files + exclude: /README\.rst$|\.pot?$ + - id: debug-statements + - id: fix-encoding-pragma + args: ["--remove"] + - id: check-case-conflict + - id: check-docstring-first + - id: check-executables-have-shebangs + - id: check-merge-conflict + # exclude files where underlines are not distinguishable from merge conflicts + exclude: /README\.rst$|^docs/.*\.rst$ + - id: check-symlinks + - id: check-xml + - id: mixed-line-ending + args: ["--fix=lf"] + - repo: https://github.com/acsone/setuptools-odoo + rev: 3.1.8 + hooks: + - id: setuptools-odoo-make-default + - id: setuptools-odoo-get-requirements + args: + - --output + - requirements.txt + - --header + - "# generated from manifests external_dependencies" + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.3 + hooks: + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + - id: ruff-format + - repo: https://github.com/OCA/pylint-odoo + rev: 7.0.5 + hooks: + - id: pylint_odoo + name: pylint with optional checks + args: + - --rcfile=.pylintrc + - --exit-zero + verbose: true + - id: pylint_odoo + args: + - --rcfile=.pylintrc-mandatory From d69857901a55ee10efc4610a0f4b6ba329f666dc Mon Sep 17 00:00:00 2001 From: Kobby Folson Date: Mon, 8 Apr 2024 12:07:51 +0100 Subject: [PATCH 02/12] add copier template file and pre-commit config --- setup/.setuptools-odoo-make-default-ignore | 2 ++ setup/README | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 setup/.setuptools-odoo-make-default-ignore create mode 100644 setup/README diff --git a/setup/.setuptools-odoo-make-default-ignore b/setup/.setuptools-odoo-make-default-ignore new file mode 100644 index 0000000..207e615 --- /dev/null +++ b/setup/.setuptools-odoo-make-default-ignore @@ -0,0 +1,2 @@ +# addons listed in this file are ignored by +# setuptools-odoo-make-default (one addon per line) diff --git a/setup/README b/setup/README new file mode 100644 index 0000000..a63d633 --- /dev/null +++ b/setup/README @@ -0,0 +1,2 @@ +To learn more about this directory, please visit +https://pypi.python.org/pypi/setuptools-odoo From ea923449b37cc5d376471fb7c83e1fd342d90cb8 Mon Sep 17 00:00:00 2001 From: Kobby Folson Date: Mon, 8 Apr 2024 12:09:54 +0100 Subject: [PATCH 03/12] init project config --- .copier-answers.yml | 2 +- .github/workflows/pre-commit.yml | 46 ++++++++++++ .github/workflows/test.yml | 70 ++++++++++++++++++ .pre-commit-config.yaml | 16 ++-- .pylintrc | 123 +++++++++++++++++++++++++++++++ .pylintrc-mandatory | 98 ++++++++++++++++++++++++ .ruff.toml | 30 ++++++++ README.md | 38 ++++++++++ 8 files changed, 414 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .github/workflows/test.yml create mode 100644 .pylintrc create mode 100644 .pylintrc-mandatory create mode 100644 .ruff.toml diff --git a/.copier-answers.yml b/.copier-answers.yml index 9da44a6..8d37945 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -13,7 +13,7 @@ github_enable_stale_action: false github_enforce_dev_status_compatibility: false include_wkhtmltopdf: false odoo_test_flavor: Both -odoo_version: 15.0 +odoo_version: 17.0 org_name: Glo Networks org_slug: GlodoUK rebel_module_groups: [] diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..c58f629 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,46 @@ +name: pre-commit + +on: + pull_request: + branches: + - "17.0*" + push: + branches: + - "17.0" + - "17.0-ocabot-*" + +jobs: + pre-commit: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v2 + with: + python-version: "3.11" + - name: Get python version + run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV + - uses: actions/cache@v1 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + - name: Install pre-commit + run: pip install pre-commit + - name: Run pre-commit + run: pre-commit run --all-files --show-diff-on-failure --color=always + env: + # Consider valid a PR that changes README fragments but doesn't + # change the README.rst file itself. It's not really a problem + # because the bot will update it anyway after merge. This way, we + # lower the barrier for functional contributors that want to fix the + # readme fragments, while still letting developers get README + # auto-generated (which also helps functionals when using runboat). + # DOCS https://pre-commit.com/#temporarily-disabling-hooks + SKIP: oca-gen-addon-readme + - name: Check that all files generated by pre-commit are in git + run: | + newfiles="$(git ls-files --others --exclude-from=.gitignore)" + if [ "$newfiles" != "" ] ; then + echo "Please check-in the following files:" + echo "$newfiles" + exit 1 + fi diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..6640252 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,70 @@ +name: tests + +on: + pull_request: + branches: + - "17.0*" + push: + branches: + - "17.0" + - "17.0-ocabot-*" + +jobs: + unreleased-deps: + runs-on: ubuntu-latest + name: Detect unreleased dependencies + steps: + - uses: actions/checkout@v3 + - run: | + for reqfile in requirements.txt test-requirements.txt ; do + if [ -f ${reqfile} ] ; then + result=0 + # reject non-comment lines that contain a / (i.e. URLs, relative paths) + grep "^[^#].*/" ${reqfile} || result=$? + if [ $result -eq 0 ] ; then + echo "Unreleased dependencies found in ${reqfile}." + exit 1 + fi + fi + done + test: + runs-on: ubuntu-22.04 + container: ${{ matrix.container }} + name: ${{ matrix.name }} + strategy: + fail-fast: false + matrix: + include: + - container: ghcr.io/oca/oca-ci/py3.10-odoo17.0:latest + name: test with Odoo + - container: ghcr.io/oca/oca-ci/py3.10-ocb17.0:latest + name: test with OCB + makepot: "false" + services: + postgres: + image: postgres:12.0 + env: + POSTGRES_USER: odoo + POSTGRES_PASSWORD: odoo + POSTGRES_DB: odoo + ports: + - 5432:5432 + steps: + - uses: actions/checkout@v3 + with: + persist-credentials: false + - name: Install addons and dependencies + run: oca_install_addons + - name: Check licenses + run: manifestoo -d . check-licenses + continue-on-error: true + - name: Check development status + run: manifestoo -d . check-dev-status --default-dev-status=Beta + continue-on-error: true + - name: Initialize test db + run: oca_init_test_database + - name: Run tests + run: oca_run_tests + - name: Update .pot files + run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }} + if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'GlodoUK' }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 31cdacc..dcc2f79 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ exclude: | (LICENSE.*|COPYING.*) default_language_version: python: python3 - node: "14.18.0" + node: "16.17.0" repos: - repo: local hooks: @@ -46,7 +46,7 @@ repos: - id: oca-gen-addon-readme args: - --addons-dir=. - - --branch=15.0 + - --branch=17.0 - --org-name=GlodoUK - --repo-name=sale - --if-source-changed @@ -57,18 +57,18 @@ repos: - id: oca-checks-odoo-module - id: oca-checks-po - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.4.1 + rev: v2.7.1 hooks: - id: prettier name: prettier (with plugin-xml) additional_dependencies: - - "prettier@2.4.1" - - "@prettier/plugin-xml@1.1.0" + - "prettier@2.7.1" + - "@prettier/plugin-xml@2.2.0" args: - --plugin=@prettier/plugin-xml files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$ - repo: https://github.com/pre-commit/mirrors-eslint - rev: v7.32.0 + rev: v8.24.0 hooks: - id: eslint verbose: true @@ -76,7 +76,7 @@ repos: - --color - --fix - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.3.0 hooks: - id: trailing-whitespace # exclude autogenerated files @@ -114,7 +114,7 @@ repos: args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/OCA/pylint-odoo - rev: 7.0.5 + rev: v9.0.4 hooks: - id: pylint_odoo name: pylint with optional checks diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 0000000..69944ac --- /dev/null +++ b/.pylintrc @@ -0,0 +1,123 @@ + + +[MASTER] +load-plugins=pylint_odoo +score=n + +[ODOOLINT] +readme-template-url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" +manifest-required-authors=Glo Networks +manifest-required-keys=license +manifest-deprecated-keys=description,active +license-allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3 +valid-odoo-versions=17.0 + +[MESSAGES CONTROL] +disable=all + +# This .pylintrc contains optional AND mandatory checks and is meant to be +# loaded in an IDE to have it check everything, in the hope this will make +# optional checks more visible to contributors who otherwise never look at a +# green travis to see optional checks that failed. +# .pylintrc-mandatory containing only mandatory checks is used the pre-commit +# config as a blocking check. + +enable=anomalous-backslash-in-string, + api-one-deprecated, + api-one-multi-together, + assignment-from-none, + attribute-deprecated, + class-camelcase, + dangerous-default-value, + dangerous-view-replace-wo-priority, + development-status-allowed, + duplicate-id-csv, + duplicate-key, + duplicate-xml-fields, + duplicate-xml-record-id, + eval-referenced, + eval-used, + incoherent-interpreter-exec-perm, + license-allowed, + manifest-author-string, + manifest-deprecated-key, + manifest-required-author, + manifest-required-key, + manifest-version-format, + method-compute, + method-inverse, + method-required-super, + method-search, + openerp-exception-warning, + pointless-statement, + pointless-string-statement, + print-used, + redundant-keyword-arg, + redundant-modulename-xml, + reimported, + relative-import, + return-in-init, + rst-syntax-error, + sql-injection, + too-few-format-args, + translation-field, + translation-required, + unreachable, + use-vim-comment, + wrong-tabs-instead-of-spaces, + xml-syntax-error, + attribute-string-redundant, + character-not-valid-in-resource-link, + consider-merging-classes-inherited, + context-overridden, + create-user-wo-reset-password, + dangerous-filter-wo-user, + dangerous-qweb-replace-wo-priority, + deprecated-data-xml-node, + deprecated-openerp-xml-node, + duplicate-po-message-definition, + except-pass, + file-not-used, + invalid-commit, + manifest-maintainers-list, + missing-newline-extrafiles, + missing-readme, + missing-return, + odoo-addons-relative-import, + old-api7-method-defined, + po-msgstr-variables, + po-syntax-error, + renamed-field-parameter, + resource-not-exist, + str-format-used, + test-folder-imported, + translation-contains-variable, + translation-positional-used, + unnecessary-utf8-coding-comment, + website-manifest-key-not-valid-uri, + xml-attribute-translatable, + xml-deprecated-qweb-directive, + xml-deprecated-tree-attribute, + external-request-timeout, + # messages that do not cause the lint step to fail + consider-merging-classes-inherited, + create-user-wo-reset-password, + dangerous-filter-wo-user, + deprecated-module, + file-not-used, + invalid-commit, + missing-manifest-dependency, + missing-newline-extrafiles, + missing-readme, + no-utf8-coding-comment, + odoo-addons-relative-import, + old-api7-method-defined, + redefined-builtin, + too-complex, + unnecessary-utf8-coding-comment + + +[REPORTS] +msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} +output-format=colorized +reports=no diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory new file mode 100644 index 0000000..4594db8 --- /dev/null +++ b/.pylintrc-mandatory @@ -0,0 +1,98 @@ + +[MASTER] +load-plugins=pylint_odoo +score=n + +[ODOOLINT] +readme-template-url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" +manifest-required-authors=Glo Networks +manifest-required-keys=license +manifest-deprecated-keys=description,active +license-allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3 +valid-odoo-versions=17.0 + +[MESSAGES CONTROL] +disable=all + +enable=anomalous-backslash-in-string, + api-one-deprecated, + api-one-multi-together, + assignment-from-none, + attribute-deprecated, + class-camelcase, + dangerous-default-value, + dangerous-view-replace-wo-priority, + development-status-allowed, + duplicate-id-csv, + duplicate-key, + duplicate-xml-fields, + duplicate-xml-record-id, + eval-referenced, + eval-used, + incoherent-interpreter-exec-perm, + license-allowed, + manifest-author-string, + manifest-deprecated-key, + manifest-required-author, + manifest-required-key, + manifest-version-format, + method-compute, + method-inverse, + method-required-super, + method-search, + openerp-exception-warning, + pointless-statement, + pointless-string-statement, + print-used, + redundant-keyword-arg, + redundant-modulename-xml, + reimported, + relative-import, + return-in-init, + rst-syntax-error, + sql-injection, + too-few-format-args, + translation-field, + translation-required, + unreachable, + use-vim-comment, + wrong-tabs-instead-of-spaces, + xml-syntax-error, + attribute-string-redundant, + character-not-valid-in-resource-link, + consider-merging-classes-inherited, + context-overridden, + create-user-wo-reset-password, + dangerous-filter-wo-user, + dangerous-qweb-replace-wo-priority, + deprecated-data-xml-node, + deprecated-openerp-xml-node, + duplicate-po-message-definition, + except-pass, + file-not-used, + invalid-commit, + manifest-maintainers-list, + missing-newline-extrafiles, + missing-readme, + missing-return, + odoo-addons-relative-import, + old-api7-method-defined, + po-msgstr-variables, + po-syntax-error, + renamed-field-parameter, + resource-not-exist, + str-format-used, + test-folder-imported, + translation-contains-variable, + translation-positional-used, + unnecessary-utf8-coding-comment, + website-manifest-key-not-valid-uri, + xml-attribute-translatable, + xml-deprecated-qweb-directive, + xml-deprecated-tree-attribute, + external-request-timeout + +[REPORTS] +msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} +output-format=colorized +reports=no diff --git a/.ruff.toml b/.ruff.toml new file mode 100644 index 0000000..0240c75 --- /dev/null +++ b/.ruff.toml @@ -0,0 +1,30 @@ + +target-version = "py310" +fix = true + +[lint] +extend-select = [ + "B", + "C90", + "E501", # line too long (default 88) + "I", # isort + "UP", # pyupgrade +] +exclude = ["setup/*"] + +[format] +exclude = ["setup/*"] + +[per-file-ignores] +"__init__.py" = ["F401", "I001"] # ignore unused and unsorted imports in __init__.py +"__manifest__.py" = ["B018"] # useless expression + +[isort] +section-order = ["future", "standard-library", "third-party", "odoo", "odoo-addons", "first-party", "local-folder"] + +[isort.sections] +"odoo" = ["odoo"] +"odoo-addons" = ["odoo.addons"] + +[mccabe] +max-complexity = 16 diff --git a/README.md b/README.md index e69de29..15beae9 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,38 @@ +<<<<<<< before updating +======= + + +[![Pre-commit Status](https://github.com/GlodoUK/sale/actions/workflows/pre-commit.yml/badge.svg?branch=17.0)](https://github.com/GlodoUK/sale/actions/workflows/pre-commit.yml?query=branch%3A17.0) +[![Build Status](https://github.com/GlodoUK/sale/actions/workflows/test.yml/badge.svg?branch=17.0)](https://github.com/GlodoUK/sale/actions/workflows/test.yml?query=branch%3A17.0) +[![codecov](https://codecov.io/gh/GlodoUK/sale/branch/17.0/graph/badge.svg)](https://codecov.io/gh/GlodoUK/sale) + + + + +# Sale addons for Odoo + +Sale addons for Odoo + + + + + +[//]: # (addons) + +This part will be replaced when running the oca-gen-addons-table script from OCA/maintainer-tools. + +[//]: # (end addons) + + + +## Licenses + +This repository is licensed under [AGPL-3.0](LICENSE). + +However, each module can have a totally different license, as long as they adhere to Glo Networks +policy. Consult each module's `__manifest__.py` file, which contains a `license` key +that explains its license. + +---- + +>>>>>>> after updating From a8e99bc53aa113f0df157786ab0a4c007be2cd6b Mon Sep 17 00:00:00 2001 From: Kobby Folson Date: Mon, 8 Apr 2024 20:41:28 +0100 Subject: [PATCH 04/12] add sale_pricelist_customer_ref --- .pre-commit-config.yaml | 20 +++++++++---------- sale_pricelist_customer_ref/README.rst | 3 +++ sale_pricelist_customer_ref/__init__.py | 1 + sale_pricelist_customer_ref/__manifest__.py | 13 ++++++++++++ .../models/__init__.py | 1 + .../models/product_pricelist_item.py | 7 +++++++ .../views/product_pricelist.xml | 13 ++++++++++++ 7 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 sale_pricelist_customer_ref/README.rst create mode 100644 sale_pricelist_customer_ref/__init__.py create mode 100644 sale_pricelist_customer_ref/__manifest__.py create mode 100644 sale_pricelist_customer_ref/models/__init__.py create mode 100644 sale_pricelist_customer_ref/models/product_pricelist_item.py create mode 100644 sale_pricelist_customer_ref/views/product_pricelist.xml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dcc2f79..be1234b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -97,16 +97,16 @@ repos: - id: check-xml - id: mixed-line-ending args: ["--fix=lf"] - - repo: https://github.com/acsone/setuptools-odoo - rev: 3.1.8 - hooks: - - id: setuptools-odoo-make-default - - id: setuptools-odoo-get-requirements - args: - - --output - - requirements.txt - - --header - - "# generated from manifests external_dependencies" + # - repo: https://github.com/acsone/setuptools-odoo + # rev: 3.1.8 + # hooks: + # - id: setuptools-odoo-make-default + # - id: setuptools-odoo-get-requirements + # args: + # - --output + # - requirements.txt + # - --header + # - "# generated from manifests external_dependencies" - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.3 hooks: diff --git a/sale_pricelist_customer_ref/README.rst b/sale_pricelist_customer_ref/README.rst new file mode 100644 index 0000000..2d3385b --- /dev/null +++ b/sale_pricelist_customer_ref/README.rst @@ -0,0 +1,3 @@ +=========================== +SALE PRICELIST CUSTOMER REF +=========================== diff --git a/sale_pricelist_customer_ref/__init__.py b/sale_pricelist_customer_ref/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/sale_pricelist_customer_ref/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/sale_pricelist_customer_ref/__manifest__.py b/sale_pricelist_customer_ref/__manifest__.py new file mode 100644 index 0000000..0ac559a --- /dev/null +++ b/sale_pricelist_customer_ref/__manifest__.py @@ -0,0 +1,13 @@ +{ + "name": "sale_pricelist_customer_ref", + "summary": "Adds customer ref field to pricelist item.", + "version": "17.0.1.0.0", + "category": "Sales", + "author": "Glo Networks", + "website": "https://github.com/GlodoUK/sale", + "depends": [ + "product", + ], + "data": ["views/product_pricelist.xml"], + "license": "LGPL-3", +} diff --git a/sale_pricelist_customer_ref/models/__init__.py b/sale_pricelist_customer_ref/models/__init__.py new file mode 100644 index 0000000..41c51bd --- /dev/null +++ b/sale_pricelist_customer_ref/models/__init__.py @@ -0,0 +1 @@ +from . import product_pricelist_item diff --git a/sale_pricelist_customer_ref/models/product_pricelist_item.py b/sale_pricelist_customer_ref/models/product_pricelist_item.py new file mode 100644 index 0000000..584a9f2 --- /dev/null +++ b/sale_pricelist_customer_ref/models/product_pricelist_item.py @@ -0,0 +1,7 @@ +from odoo import fields, models + + +class ProductPricelistItem(models.Model): + _inherit = "product.pricelist.item" + + customer_ref = fields.Char(string="Customer Reference") diff --git a/sale_pricelist_customer_ref/views/product_pricelist.xml b/sale_pricelist_customer_ref/views/product_pricelist.xml new file mode 100644 index 0000000..b5b47c2 --- /dev/null +++ b/sale_pricelist_customer_ref/views/product_pricelist.xml @@ -0,0 +1,13 @@ + + + + product.pricelist.view + product.pricelist + + + + + + + + From 3c6005dc9ced64b4505bb986272923fd166999f7 Mon Sep 17 00:00:00 2001 From: Kobby Folson Date: Mon, 8 Apr 2024 20:42:53 +0100 Subject: [PATCH 05/12] add sale_pricelist_customer_ref --- .pre-commit-config.yaml | 20 ++++++++++---------- setup/.setuptools-odoo-make-default-ignore | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index be1234b..dcc2f79 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -97,16 +97,16 @@ repos: - id: check-xml - id: mixed-line-ending args: ["--fix=lf"] - # - repo: https://github.com/acsone/setuptools-odoo - # rev: 3.1.8 - # hooks: - # - id: setuptools-odoo-make-default - # - id: setuptools-odoo-get-requirements - # args: - # - --output - # - requirements.txt - # - --header - # - "# generated from manifests external_dependencies" + - repo: https://github.com/acsone/setuptools-odoo + rev: 3.1.8 + hooks: + - id: setuptools-odoo-make-default + - id: setuptools-odoo-get-requirements + args: + - --output + - requirements.txt + - --header + - "# generated from manifests external_dependencies" - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.3 hooks: diff --git a/setup/.setuptools-odoo-make-default-ignore b/setup/.setuptools-odoo-make-default-ignore index 207e615..1d7cb1d 100644 --- a/setup/.setuptools-odoo-make-default-ignore +++ b/setup/.setuptools-odoo-make-default-ignore @@ -1,2 +1,3 @@ # addons listed in this file are ignored by # setuptools-odoo-make-default (one addon per line) +sale_pricelist_customer_ref From 0fae2df28478871dbc0482bfbe02efbc82a98a63 Mon Sep 17 00:00:00 2001 From: Kobby Folson Date: Mon, 8 Apr 2024 20:49:08 +0100 Subject: [PATCH 06/12] lint --- sale_pricelist_customer_ref/views/product_pricelist.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sale_pricelist_customer_ref/views/product_pricelist.xml b/sale_pricelist_customer_ref/views/product_pricelist.xml index b5b47c2..eabd805 100644 --- a/sale_pricelist_customer_ref/views/product_pricelist.xml +++ b/sale_pricelist_customer_ref/views/product_pricelist.xml @@ -10,4 +10,6 @@ + + From b2ad85a16ec0c0d2a6dc311e8c06c8610b7023dc Mon Sep 17 00:00:00 2001 From: Kobby Folson Date: Mon, 8 Apr 2024 20:53:13 +0100 Subject: [PATCH 07/12] take out failing pre-commit hook --- .pre-commit-config.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dcc2f79..be1234b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -97,16 +97,16 @@ repos: - id: check-xml - id: mixed-line-ending args: ["--fix=lf"] - - repo: https://github.com/acsone/setuptools-odoo - rev: 3.1.8 - hooks: - - id: setuptools-odoo-make-default - - id: setuptools-odoo-get-requirements - args: - - --output - - requirements.txt - - --header - - "# generated from manifests external_dependencies" + # - repo: https://github.com/acsone/setuptools-odoo + # rev: 3.1.8 + # hooks: + # - id: setuptools-odoo-make-default + # - id: setuptools-odoo-get-requirements + # args: + # - --output + # - requirements.txt + # - --header + # - "# generated from manifests external_dependencies" - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.3 hooks: From ee1927f0bb7fac20b9b93f516d1bbb01f7740284 Mon Sep 17 00:00:00 2001 From: Kobby Folson Date: Mon, 8 Apr 2024 20:59:47 +0100 Subject: [PATCH 08/12] fix ci error --- sale_pricelist_customer_ref/views/product_pricelist.xml | 1 - setup/.setuptools-odoo-make-default-ignore | 3 --- setup/README | 2 -- 3 files changed, 6 deletions(-) delete mode 100644 setup/.setuptools-odoo-make-default-ignore delete mode 100644 setup/README diff --git a/sale_pricelist_customer_ref/views/product_pricelist.xml b/sale_pricelist_customer_ref/views/product_pricelist.xml index eabd805..9f3034f 100644 --- a/sale_pricelist_customer_ref/views/product_pricelist.xml +++ b/sale_pricelist_customer_ref/views/product_pricelist.xml @@ -11,5 +11,4 @@ - diff --git a/setup/.setuptools-odoo-make-default-ignore b/setup/.setuptools-odoo-make-default-ignore deleted file mode 100644 index 1d7cb1d..0000000 --- a/setup/.setuptools-odoo-make-default-ignore +++ /dev/null @@ -1,3 +0,0 @@ -# addons listed in this file are ignored by -# setuptools-odoo-make-default (one addon per line) -sale_pricelist_customer_ref diff --git a/setup/README b/setup/README deleted file mode 100644 index a63d633..0000000 --- a/setup/README +++ /dev/null @@ -1,2 +0,0 @@ -To learn more about this directory, please visit -https://pypi.python.org/pypi/setuptools-odoo From 72d75a16d21914c5e87790b7726947dd5588caab Mon Sep 17 00:00:00 2001 From: Kobby Folson Date: Mon, 8 Apr 2024 21:04:13 +0100 Subject: [PATCH 09/12] fix ci error --- .pre-commit-config.yaml | 20 +++++++++---------- .../views/product_pricelist.xml | 1 - setup/.setuptools-odoo-make-default-ignore | 3 +++ setup/README | 2 ++ 4 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 setup/.setuptools-odoo-make-default-ignore create mode 100644 setup/README diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index be1234b..dcc2f79 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -97,16 +97,16 @@ repos: - id: check-xml - id: mixed-line-ending args: ["--fix=lf"] - # - repo: https://github.com/acsone/setuptools-odoo - # rev: 3.1.8 - # hooks: - # - id: setuptools-odoo-make-default - # - id: setuptools-odoo-get-requirements - # args: - # - --output - # - requirements.txt - # - --header - # - "# generated from manifests external_dependencies" + - repo: https://github.com/acsone/setuptools-odoo + rev: 3.1.8 + hooks: + - id: setuptools-odoo-make-default + - id: setuptools-odoo-get-requirements + args: + - --output + - requirements.txt + - --header + - "# generated from manifests external_dependencies" - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.3 hooks: diff --git a/sale_pricelist_customer_ref/views/product_pricelist.xml b/sale_pricelist_customer_ref/views/product_pricelist.xml index 9f3034f..b5b47c2 100644 --- a/sale_pricelist_customer_ref/views/product_pricelist.xml +++ b/sale_pricelist_customer_ref/views/product_pricelist.xml @@ -10,5 +10,4 @@ - diff --git a/setup/.setuptools-odoo-make-default-ignore b/setup/.setuptools-odoo-make-default-ignore new file mode 100644 index 0000000..1d7cb1d --- /dev/null +++ b/setup/.setuptools-odoo-make-default-ignore @@ -0,0 +1,3 @@ +# addons listed in this file are ignored by +# setuptools-odoo-make-default (one addon per line) +sale_pricelist_customer_ref diff --git a/setup/README b/setup/README new file mode 100644 index 0000000..a63d633 --- /dev/null +++ b/setup/README @@ -0,0 +1,2 @@ +To learn more about this directory, please visit +https://pypi.python.org/pypi/setuptools-odoo From 69811ee8bde1dd93bab88575286a9bb22827e1f7 Mon Sep 17 00:00:00 2001 From: Kobby Folson Date: Mon, 8 Apr 2024 21:09:39 +0100 Subject: [PATCH 10/12] fix ci error --- .pre-commit-config.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dcc2f79..be1234b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -97,16 +97,16 @@ repos: - id: check-xml - id: mixed-line-ending args: ["--fix=lf"] - - repo: https://github.com/acsone/setuptools-odoo - rev: 3.1.8 - hooks: - - id: setuptools-odoo-make-default - - id: setuptools-odoo-get-requirements - args: - - --output - - requirements.txt - - --header - - "# generated from manifests external_dependencies" + # - repo: https://github.com/acsone/setuptools-odoo + # rev: 3.1.8 + # hooks: + # - id: setuptools-odoo-make-default + # - id: setuptools-odoo-get-requirements + # args: + # - --output + # - requirements.txt + # - --header + # - "# generated from manifests external_dependencies" - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.3 hooks: From 6b2e314dfa721a97e22071c034ef009a2d3db9e4 Mon Sep 17 00:00:00 2001 From: Kobby Folson Date: Tue, 9 Apr 2024 09:56:59 +0100 Subject: [PATCH 11/12] add .gitignore --- .gitignore | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0090721 --- /dev/null +++ b/.gitignore @@ -0,0 +1,75 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +/.venv +/.pytest_cache +/.ruff_cache + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +bin/ +build/ +develop-eggs/ +dist/ +eggs/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg +*.eggs + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo + +# Pycharm +.idea + +# Eclipse +.settings + +# Visual Studio cache/options directory +.vs/ +.vscode + +# OSX Files +.DS_Store + +# Django stuff: +*.log + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject + +# Rope +.ropeproject + +# Sphinx documentation +docs/_build/ + +# Backup files +*~ +*.swp + +# OCA rules +!static/lib/ From bd17419c1bc1eb7e326948ed894b79803abb464c Mon Sep 17 00:00:00 2001 From: Kobby Folson Date: Tue, 9 Apr 2024 10:10:04 +0100 Subject: [PATCH 12/12] update pre-commit-config with whool hook --- .pre-commit-config.yaml | 14 ++++---------- sale_pricelist_customer_ref/pyproject.toml | 3 +++ setup/.setuptools-odoo-make-default-ignore | 3 --- setup/README | 2 -- 4 files changed, 7 insertions(+), 15 deletions(-) create mode 100644 sale_pricelist_customer_ref/pyproject.toml delete mode 100644 setup/.setuptools-odoo-make-default-ignore delete mode 100644 setup/README diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index be1234b..88b83bb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,6 +36,10 @@ repos: entry: found a en.po file language: fail files: '[a-zA-Z0-9_]*/i18n/en\.po$' + - repo: https://github.com/sbidoul/whool + rev: v0.5 + hooks: + - id: whool-init - repo: https://github.com/oca/maintainer-tools rev: 9a170331575a265c092ee6b24b845ec508e8ef75 hooks: @@ -97,16 +101,6 @@ repos: - id: check-xml - id: mixed-line-ending args: ["--fix=lf"] - # - repo: https://github.com/acsone/setuptools-odoo - # rev: 3.1.8 - # hooks: - # - id: setuptools-odoo-make-default - # - id: setuptools-odoo-get-requirements - # args: - # - --output - # - requirements.txt - # - --header - # - "# generated from manifests external_dependencies" - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.3 hooks: diff --git a/sale_pricelist_customer_ref/pyproject.toml b/sale_pricelist_customer_ref/pyproject.toml new file mode 100644 index 0000000..4231d0c --- /dev/null +++ b/sale_pricelist_customer_ref/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/setup/.setuptools-odoo-make-default-ignore b/setup/.setuptools-odoo-make-default-ignore deleted file mode 100644 index 1d7cb1d..0000000 --- a/setup/.setuptools-odoo-make-default-ignore +++ /dev/null @@ -1,3 +0,0 @@ -# addons listed in this file are ignored by -# setuptools-odoo-make-default (one addon per line) -sale_pricelist_customer_ref diff --git a/setup/README b/setup/README deleted file mode 100644 index a63d633..0000000 --- a/setup/README +++ /dev/null @@ -1,2 +0,0 @@ -To learn more about this directory, please visit -https://pypi.python.org/pypi/setuptools-odoo