diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index d4e13d07d..000000000 --- a/.coveragerc +++ /dev/null @@ -1,17 +0,0 @@ -# Config file .coveragerc - -[report] -include = - */compassion-modules/* - -omit = - */tests/* - *__init__.py - -# Regexes for lines to exclude from consideration -exclude_lines = - # Have to re-enable the standard pragma - pragma: no cover - - # Don't complain about null context checking - if context is None: diff --git a/.eslintrc.yml b/.eslintrc.yml index 9429bc688..fed88d70d 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -22,6 +22,7 @@ globals: odoo: readonly openerp: readonly owl: readonly + luxon: readonly # Styling is handled by Prettier, so we only need to enable AST rules; # see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index e2336b859..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: pre-commit - -on: - pull_request: - push: - branches: [master] - release: - types: [created] - -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: "3.12" - - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 000000000..c173489f8 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,45 @@ +name: pre-commit + +on: + pull_request: + branches: + - "14.0*" + push: + branches: + - "14.0" + +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/.oca_hooks.cfg b/.oca_hooks.cfg new file mode 100644 index 000000000..1f3e3e426 --- /dev/null +++ b/.oca_hooks.cfg @@ -0,0 +1,2 @@ +[MESSAGES_CONTROL] +disable=xml-deprecated-data-node,xml-deprecated-tree-attribute diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 95fb195d0..b7b045f0f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,29 +1,133 @@ +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.13.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/CompassionCH/compassion-modules"] + - id: oca-gen-addon-readme + args: + - --addons-dir=. + - --branch=14.0 + - --org-name=CompassionCH + - --repo-name=compassion-modules + - --if-source-changed + - --keep-source-digest + - --convert-fragments-to-markdown + - 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 + rev: v2.1.2 hooks: - id: prettier - # https://github.com/prettier/prettier/issues/12143 - exclude: "}$" + name: prettier (with plugin-xml) + additional_dependencies: + - "prettier@2.1.2" + - "@prettier/plugin-xml@0.12.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.8.1 + hooks: + - id: eslint + verbose: true + args: + - --color + - --fix - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v3.2.0 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: debug-statements - - id: end-of-file-fixer - - id: fix-encoding-pragma - args: ["--remove"] - id: mixed-line-ending args: ["--fix=lf"] - - id: trailing-whitespace + - repo: https://github.com/asottile/pyupgrade + rev: v2.7.2 + hooks: + - id: pyupgrade + args: ["--keep-percent-format"] + - 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: [--exit-non-zero-on-fix] + args: [--fix, --exit-non-zero-on-fix] - id: ruff-format + - repo: https://github.com/OCA/pylint-odoo + rev: 7.0.2 + hooks: + - id: pylint_odoo + name: pylint with optional checks + args: + - --rcfile=.pylintrc + - --exit-zero + verbose: true + - id: pylint_odoo + args: + - --rcfile=.pylintrc-mandatory diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml deleted file mode 100644 index 1a89f9ece..000000000 --- a/.pre-commit-hooks.yaml +++ /dev/null @@ -1,41 +0,0 @@ -- id: oca-gen-addon-readme - name: Generate addons README files from fragments - always_run: true - entry: oca-gen-addon-readme - language: python - pass_filenames: false - -- id: oca-gen-addons-table - name: Generate addons table in README - always_run: true - entry: oca-gen-addons-table - language: python - pass_filenames: false - -- id: oca-gen-addon-icon - name: Generate addons icons - always_run: true - entry: oca-gen-addon-icon - language: python - pass_filenames: false - -- id: oca-update-pre-commit-excluded-addons - name: Update pre-commit excluded addons - entry: oca-update-pre-commit-excluded-addons - pass_filenames: false - language: python - always_run: true - -- id: oca-fix-manifest-website - name: Fix the manifest website key - entry: oca-fix-manifest-website - pass_filenames: false - language: python - files: (__manifest__\.py|__openerp__\.py|__terp__\.py)$ - -- id: oca-gen-external-dependencies - name: Generate requirements.txt for an addons directory - entry: oca-gen-external-dependencies - language: python - pass_filenames: false - files: (__manifest__\.py|__openerp__\.py|__terp__\.py|setup\.py|pyproject\.toml)$ diff --git a/.prettierrc.yml b/.prettierrc.yml deleted file mode 100644 index 5b6d4b361..000000000 --- a/.prettierrc.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Defaults for all prettier-supported languages. -# Prettier will complete this with settings from .editorconfig file. -bracketSpacing: false -printWidth: 88 -proseWrap: always -semi: true -trailingComma: "es5" -xmlWhitespaceSensitivity: "strict" diff --git a/.pylintrc b/.pylintrc index d1f72970b..7adfd06d2 100644 --- a/.pylintrc +++ b/.pylintrc @@ -6,7 +6,7 @@ score=n [ODOOLINT] readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" -manifest_required_authors=Odoo Community Association (OCA) +manifest_required_authors=Compassion Switzerland 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 diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory index 3bf8ceefb..ddc691654 100644 --- a/.pylintrc-mandatory +++ b/.pylintrc-mandatory @@ -5,7 +5,7 @@ score=n [ODOOLINT] readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst" -manifest_required_authors=Odoo Community Association (OCA) +manifest_required_authors=Compassion Switzerland 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 diff --git a/.ruff.toml b/.ruff.toml index a484d01b2..f31b3125c 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -1,4 +1,4 @@ -target-version = "py38" + fix = true [lint] @@ -7,7 +7,6 @@ extend-select = [ "C90", "E501", # line too long (default 88) "I", # isort - "UP", # pyupgrade ] exclude = ["setup/*"] @@ -17,6 +16,7 @@ exclude = ["setup/*"] [per-file-ignores] "__init__.py" = ["F401", "I001"] # ignore unused and unsorted imports in __init__.py "__manifest__.py" = ["B018"] # useless expression +"rest_json_api/http.py" = ["B018"] # pointless-statement [isort] section-order = ["future", "standard-library", "third-party", "odoo", "odoo-addons", "first-party", "local-folder"] diff --git a/.sonarcloud.properties b/.sonarcloud.properties index 5ea75c6e2..a3282fd7c 100644 --- a/.sonarcloud.properties +++ b/.sonarcloud.properties @@ -1,2 +1,2 @@ # Exclude files or directories -sonar.exclusions=**/__manifest__.py,**/thank_you_quote_template.html +sonar.exclusions=**/__manifest__.py,**/thank_you_quote_template.html,**/description/index.html diff --git a/README.md b/README.md index e7fc2b775..73f53ca37 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,72 @@ -# Compassion modules - -This project holds Odoo modules needed for any Compassion office in order to manage -sponsorships of its country. It connects Odoo with GMC webservices. - -[//]: # "addons" - -## Available addons - -| addon | version | maintainers | summary | -| --------------------------------------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | -| [account_reconcile_compassion](account_reconcile_compassion/) | 14.0.1.1.0 | | Bank Statement Reconcile for Compassion CH | -| [advanced_translation](advanced_translation/) | 14.0.1.0.0 | | Advanced Translation | -| [child_compassion](child_compassion/) | 14.0.1.0.0 | | Compassion Children | -| [child_protection](child_protection/) | 14.0.1.0.0 | | Add fields for tracking acceptance of child protection charter | -| [crm_compassion](crm_compassion/) | 14.0.1.0.0 | [![ecino](https://github.com/ecino.png?size=30px)](https://github.com/ecino) | Compassion Events and Opportunities | -| [crm_request](crm_request/) | 14.0.1.0.0 | [![ecino](https://github.com/ecino.png?size=30px)](https://github.com/ecino) | Enables Customer Support Inbox | -| [gift_compassion](gift_compassion/) | 14.0.1.0.2 | | Compassion Sponsorship Gifts | -| [intervention_compassion](intervention_compassion/) | 14.0.1.0.0 | | Compassion Interventions | -| [label](label/) | 14.0.1.0.0 | | Mass Label Reporting | -| [message_center_compassion](message_center_compassion/) | 14.0.1.0.2 | | Compassion CH Message Center | -| [mis_builder_spn_info](mis_builder_spn_info/) | 0.1 | | Info on aquisition and departure to report on spn evolution | -| [onramp_simulator](onramp_simulator/) | 14.0.1.0.0 | | Send messages to Compassion Onramps | -| [partner_auto_match](partner_auto_match/) | 14.0.1.0.0 | [![ecino](https://github.com/ecino.png?size=30px)](https://github.com/ecino) | Find existing contact given any partner data. | -| [partner_communication](partner_communication/) | 14.0.1.0.0 | | Partner Communication | -| [partner_communication_compassion](partner_communication_compassion/) | 14.0.1.1.0 | | Compassion Partner Communications | -| [partner_communication_crm_phone](partner_communication_crm_phone/) | 14.0.1.0.0 | | Partner Communication CRM Phone | -| [partner_communication_omr](partner_communication_omr/) | 14.0.1.0.0 | | Partner Communication OMR | -| [partner_communication_reminder](partner_communication_reminder/) | 14.0.1.0.0 | | Reminder features | -| [partner_communication_revision](partner_communication_revision/) | 14.0.1.0.0 | | Partner Communication Revisions | -| [partner_email_alias](partner_email_alias/) | 14.0.1.0.0 | [![ecino](https://github.com/ecino.png?size=30px)](https://github.com/ecino) | Add many e-mail addresses on a contact | -| [partner_personal_info](partner_personal_info/) | 14.0.1.0.0 | | Adds a tab on partners for showing personal information | -| [partner_salutation](partner_salutation/) | 14.0.1.0.0 | [![ecino](https://github.com/ecino.png?size=30px)](https://github.com/ecino) | Adds a salutation field on partners | -| [partner_search_fuzzy](partner_search_fuzzy/) | 14.0.1.0.0 | [![ecino](https://github.com/ecino.png?size=30px)](https://github.com/ecino) | Add fuzzy search on partners | -| [partner_segmentation](partner_segmentation/) | 14.0.1.0.0 | | Segment Sponsors | -| [rest_json_api](rest_json_api/) | 14.0.1.0.0 | | REST Json API | -| [sbc_compassion](sbc_compassion/) | 14.0.1.0.1 | | SBC - Supporter to Beneficiary Communication | -| [sbc_translation](sbc_translation/) | 12.0.1.0.0 | | SBC - Translation Platform | -| [sponsorship_compassion](sponsorship_compassion/) | 14.0.1.1.9 | | Compassion Sponsorships | -| [sponsorship_reporting](sponsorship_reporting/) | 14.0.1.0.0 | | Add the reports for the sponsorships | -| [sponsorship_sub_management](sponsorship_sub_management/) | 14.0.1.0.0 | [![ecino](https://github.com/ecino.png?size=30px)](https://github.com/ecino) [![NoeBerdoz](https://github.com/NoeBerdoz.png?size=30px)](https://github.com/NoeBerdoz) | Compassion SUB Sponsorships Management | -| [thankyou_letters](thankyou_letters/) | 14.0.1.0.0 | | Thank You Letters | -| [wordpress_configuration](wordpress_configuration/) | 14.0.0.0.0 | | Wordpress configuration for multi-company | - -[//]: # "end addons" + + +[![Pre-commit Status](https://github.com/CompassionCH/compassion-modules/actions/workflows/pre-commit.yml/badge.svg?branch=14.0)](https://github.com/CompassionCH/compassion-modules/actions/workflows/pre-commit.yml?query=branch%3A14.0) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=CompassionCH_compassion-modules&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=CompassionCH_compassion-modules) + + + + + +# Compassion Modules + +All accounting extensions needed for supporting Compassion's mission, in particular with +the child sponsosrhip program. + + + + + +[//]: # (addons) + +Available addons +---------------- +addon | version | maintainers | summary +--- | --- | --- | --- +[account_reconcile_compassion](account_reconcile_compassion/) | 14.0.1.1.1 | | Bank Statement Reconcile for Compassion CH +[advanced_translation](advanced_translation/) | 14.0.1.0.0 | | Advanced Translation +[child_compassion](child_compassion/) | 14.0.1.0.0 | | Compassion Children +[child_protection](child_protection/) | 14.0.1.0.0 | | Add fields for tracking acceptance of child protection charter +[crm_compassion](crm_compassion/) | 14.0.1.0.0 | [![ecino](https://github.com/ecino.png?size=30px)](https://github.com/ecino) | Compassion Events and Opportunities +[crm_request](crm_request/) | 14.0.1.0.0 | [![ecino](https://github.com/ecino.png?size=30px)](https://github.com/ecino) | Enables Customer Support Inbox +[gift_compassion](gift_compassion/) | 14.0.1.0.2 | | Compassion Sponsorship Gifts +[intervention_compassion](intervention_compassion/) | 14.0.1.0.0 | | Compassion Interventions +[label](label/) | 14.0.1.0.0 | | Mass Label Reporting +[message_center_compassion](message_center_compassion/) | 14.0.1.0.2 | | Compassion CH Message Center +[mis_builder_spn_info](mis_builder_spn_info/) | 0.1 | | Info on aquisition and departure to report on spn evolution +[onramp_simulator](onramp_simulator/) | 14.0.1.0.0 | | Send messages to Compassion Onramps +[partner_auto_match](partner_auto_match/) | 14.0.1.0.0 | [![ecino](https://github.com/ecino.png?size=30px)](https://github.com/ecino) | Find existing contact given any partner data. +[partner_communication](partner_communication/) | 14.0.1.0.0 | | Partner Communication +[partner_communication_compassion](partner_communication_compassion/) | 14.0.1.1.0 | | Compassion Partner Communications +[partner_communication_crm_phone](partner_communication_crm_phone/) | 14.0.1.0.0 | | Partner Communication CRM Phone +[partner_communication_omr](partner_communication_omr/) | 14.0.1.0.0 | | Partner Communication OMR +[partner_communication_reminder](partner_communication_reminder/) | 14.0.1.0.0 | | Reminder features +[partner_communication_revision](partner_communication_revision/) | 14.0.1.0.0 | | Partner Communication Revisions +[partner_email_alias](partner_email_alias/) | 14.0.1.0.0 | [![ecino](https://github.com/ecino.png?size=30px)](https://github.com/ecino) | Add many e-mail addresses on a contact +[partner_personal_info](partner_personal_info/) | 14.0.1.0.0 | | Adds a tab on partners for showing personal information +[partner_salutation](partner_salutation/) | 14.0.1.0.0 | [![ecino](https://github.com/ecino.png?size=30px)](https://github.com/ecino) | Adds a salutation field on partners +[partner_search_fuzzy](partner_search_fuzzy/) | 14.0.1.0.0 | [![ecino](https://github.com/ecino.png?size=30px)](https://github.com/ecino) | Add fuzzy search on partners +[partner_segmentation](partner_segmentation/) | 14.0.1.0.0 | | Segment Sponsors +[rest_json_api](rest_json_api/) | 14.0.1.0.0 | | REST Json API +[sbc_compassion](sbc_compassion/) | 14.0.1.0.1 | | SBC - Supporter to Participant Communication +[sbc_translation](sbc_translation/) | 12.0.1.0.0 | | SBC - Translation Platform +[sponsorship_compassion](sponsorship_compassion/) | 14.0.1.2.2 | | Compassion Sponsorships +[sponsorship_reporting](sponsorship_reporting/) | 14.0.1.0.0 | | Add the reports for the sponsorships +[sponsorship_sub_management](sponsorship_sub_management/) | 14.0.1.0.0 | [![ecino](https://github.com/ecino.png?size=30px)](https://github.com/ecino) [![NoeBerdoz](https://github.com/NoeBerdoz.png?size=30px)](https://github.com/NoeBerdoz) | Compassion SUB Sponsorships Management +[thankyou_letters](thankyou_letters/) | 14.0.1.0.0 | | Thank You Letters +[wordpress_configuration](wordpress_configuration/) | 14.0.0.0.0 | | Wordpress configuration for multi-company + +[//]: # (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 +Compassion Switzerland policy. Consult each module's `__manifest__.py` file, which +contains a `license` key that explains its license. + +--- + + diff --git a/account_reconcile_compassion/README.rst b/account_reconcile_compassion/README.rst index 1166a9082..1007bdf20 100644 --- a/account_reconcile_compassion/README.rst +++ b/account_reconcile_compassion/README.rst @@ -2,10 +2,13 @@ Bank Statement Reconcile for Compassion CH ========================================== -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d36c11e2e1131b2624921f29cdc76b2a6184f5c94f3caa573ca56f57679ff8b6 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -13,15 +16,24 @@ Bank Statement Reconcile for Compassion CH .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 -.. |badge3| image:: https://img.shields.io/badge/github-CompassionCH%2Fcompassion--switzerland-lightgray.png?logo=github - :target: https://github.com/CompassionCH/compassion-switzerland/tree/11.0/account_reconcile_compassion - :alt: CompassionCH/compassion-switzerland +.. |badge3| image:: https://img.shields.io/badge/github-CompassionCH%2Fcompassion--modules-lightgray.png?logo=github + :target: https://github.com/CompassionCH/compassion-modules/tree/14.0/account_reconcile_compassion + :alt: CompassionCH/compassion-modules |badge1| |badge2| |badge3| Reconcile rules with bvr_ref of invoice for Compassion CH. -It finds a matching invoice for the move_line and reconciles only if the amount of the payment corresponds or if it is a multiple of the invoice amount. If many invoices are found, the first reconciled invoice is the current invoice (last invoice that is not in future). Then it reconciles the other invoices from last invoice to first. +This will add a Product field in the bank statement reconcile view that +will allow to create an invoice from a received payment. When choosing a +product, an invoice will be created and will be reconciled with the +given payment. + +It finds a matching invoice for the move_line and reconciles only if the +amount of the payment corresponds or if it is a multiple of the invoice +amount. If many invoices are found, the first reconciled invoice is the +current invoice (last invoice that is not in future). Then it reconciles +the other invoices from last invoice to first. **Table of contents** @@ -31,24 +43,25 @@ It finds a matching invoice for the move_line and reconciles only if the amount Configuration ============= -You can add the following system parameter to enable an analytic account to be set on exchange rate move lines: +You can add the following system parameter to enable an analytic account +to be set on exchange rate move lines: -* account_reconcile_compassion.currency_exchange_analytic_account +- account_reconcile_compassion.currency_exchange_analytic_account Usage ===== To use this module, you need to: -* Go to Accounting -> Bank Statement -> Reconcile +- Go to Accounting -> Bank Statement -> Reconcile Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. +Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -56,27 +69,18 @@ Credits ======= Authors -~~~~~~~ +------- * Compassion CH Contributors -~~~~~~~~~~~~ +------------ -* Emanuel Cino +- Emanuel Cino Maintainers -~~~~~~~~~~~ - -This module is maintained by Compassion Switzerland. - -.. image:: https://upload.wikimedia.org/wikipedia/en/8/83/CompassionInternationalLogo.png - :alt: Compassion Switzerland - :target: https://www.compassion.ch - -Compassion Switzerland is a nonprofit organization whose -mission is to release children from extreme poverty in Jesus name. +----------- -This module is part of the `CompassionCH/compassion-switzerland `_ project on GitHub. +This module is part of the `CompassionCH/compassion-modules `_ project on GitHub. You are welcome to contribute. diff --git a/account_reconcile_compassion/__manifest__.py b/account_reconcile_compassion/__manifest__.py index 663ee552a..34f79500f 100644 --- a/account_reconcile_compassion/__manifest__.py +++ b/account_reconcile_compassion/__manifest__.py @@ -33,7 +33,7 @@ "author": "Compassion CH", "license": "AGPL-3", "category": "Finance", - "website": "http://www.compassion.ch", + "website": "https://github.com/CompassionCH/compassion-modules", "depends": [ "account", "account_reconciliation_widget", diff --git a/account_reconcile_compassion/readme/CONFIGURE.md b/account_reconcile_compassion/readme/CONFIGURE.md new file mode 100644 index 000000000..0e35550f9 --- /dev/null +++ b/account_reconcile_compassion/readme/CONFIGURE.md @@ -0,0 +1,4 @@ +You can add the following system parameter to enable an analytic account +to be set on exchange rate move lines: + +- account_reconcile_compassion.currency_exchange_analytic_account diff --git a/account_reconcile_compassion/readme/CONFIGURE.rst b/account_reconcile_compassion/readme/CONFIGURE.rst deleted file mode 100644 index 604b1a2d8..000000000 --- a/account_reconcile_compassion/readme/CONFIGURE.rst +++ /dev/null @@ -1,3 +0,0 @@ -You can add the following system parameter to enable an analytic account to be set on exchange rate move lines: - -* account_reconcile_compassion.currency_exchange_analytic_account diff --git a/account_reconcile_compassion/readme/CONTRIBUTORS.md b/account_reconcile_compassion/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..651645fe2 --- /dev/null +++ b/account_reconcile_compassion/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Emanuel Cino \<\> diff --git a/account_reconcile_compassion/readme/CONTRIBUTORS.rst b/account_reconcile_compassion/readme/CONTRIBUTORS.rst deleted file mode 100644 index 6a9ca3183..000000000 --- a/account_reconcile_compassion/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1 +0,0 @@ -* Emanuel Cino diff --git a/account_reconcile_compassion/readme/DESCRIPTION.md b/account_reconcile_compassion/readme/DESCRIPTION.md new file mode 100644 index 000000000..24b3907d8 --- /dev/null +++ b/account_reconcile_compassion/readme/DESCRIPTION.md @@ -0,0 +1,12 @@ +Reconcile rules with bvr_ref of invoice for Compassion CH. + +This will add a Product field in the bank statement reconcile view that +will allow to create an invoice from a received payment. When choosing a +product, an invoice will be created and will be reconciled with the +given payment. + +It finds a matching invoice for the move_line and reconciles only if the +amount of the payment corresponds or if it is a multiple of the invoice +amount. If many invoices are found, the first reconciled invoice is the +current invoice (last invoice that is not in future). Then it reconciles +the other invoices from last invoice to first. diff --git a/account_reconcile_compassion/readme/DESCRIPTION.rst b/account_reconcile_compassion/readme/DESCRIPTION.rst deleted file mode 100644 index 7d8927bb0..000000000 --- a/account_reconcile_compassion/readme/DESCRIPTION.rst +++ /dev/null @@ -1,6 +0,0 @@ -Reconcile rules with bvr_ref of invoice for Compassion CH. - -This will add a Product field in the bank statement reconcile view that will allow to create an invoice from a received payment. When choosing a product, an invoice will be created and will be reconciled with the given payment. - -It finds a matching invoice for the move_line and reconciles only if the amount of the payment corresponds or if it is a multiple of the invoice amount. -If many invoices are found, the first reconciled invoice is the current invoice (last invoice that is not in future). Then it reconciles the other invoices from last invoice to first. diff --git a/account_reconcile_compassion/readme/USAGE.md b/account_reconcile_compassion/readme/USAGE.md new file mode 100644 index 000000000..fb14f9d70 --- /dev/null +++ b/account_reconcile_compassion/readme/USAGE.md @@ -0,0 +1,3 @@ +To use this module, you need to: + +- Go to Accounting -\> Bank Statement -\> Reconcile diff --git a/account_reconcile_compassion/readme/USAGE.rst b/account_reconcile_compassion/readme/USAGE.rst deleted file mode 100644 index b3e512b2b..000000000 --- a/account_reconcile_compassion/readme/USAGE.rst +++ /dev/null @@ -1,3 +0,0 @@ -To use this module, you need to: - -* Go to Accounting -> Bank Statement -> Reconcile diff --git a/account_reconcile_compassion/static/description/index.html b/account_reconcile_compassion/static/description/index.html index 368d36a5e..b734d44cc 100644 --- a/account_reconcile_compassion/static/description/index.html +++ b/account_reconcile_compassion/static/description/index.html @@ -1,131 +1,95 @@ - - - - - Bank Statement Reconcile for Compassion CH - - - -
-

Bank Statement Reconcile for Compassion CH

- - -

- Beta - License: AGPL-3 - CompassionCH/compassion-switzerland -

-

Reconcile rules with bvr_ref of invoice for Compassion CH.

-

- It finds a matching invoice for the move_line and reconciles only if the amount - of the payment corresponds or if it is a multiple of the invoice amount. If many - invoices are found, the first reconciled invoice is the current invoice (last - invoice that is not in future). Then it reconciles the other invoices from last - invoice to first. -

-

Table of contents

-
- -
-
-

Configuration

-

- You can add the following system parameter to enable an analytic account to be - set on exchange rate move lines: -

-
    -
  • account_reconcile_compassion.currency_exchange_analytic_account
  • -
-
-
-

Usage

-

To use this module, you need to:

-
    -
  • Go to Accounting -> Bank Statement -> Reconcile
  • -
-
-
-

Bug Tracker

-

- Bugs are tracked on - GitHub Issues. In case of trouble, please check there if your issue has already been - reported. If you spotted it first, help us smashing it by providing a detailed - and welcomed - feedback. -

-

- Do not contact contributors directly about support or help with technical - issues. -

-
-
-

Credits

-
-

Authors

-
    -
  • Compassion CH
  • -
-
-
-

Contributors

- -
-
-

Maintainers

-

This module is maintained by Compassion Switzerland.

- Compassion Switzerland -

- Compassion Switzerland is a nonprofit organization whose mission is to - release children from extreme poverty in Jesus name. -

-

- This module is part of the - CompassionCH/compassion-switzerland - project on GitHub. -

-

You are welcome to contribute.

-
-
-
- +

Beta License: AGPL-3 CompassionCH/compassion-modules

+

Reconcile rules with bvr_ref of invoice for Compassion CH.

+

This will add a Product field in the bank statement reconcile view that +will allow to create an invoice from a received payment. When choosing a +product, an invoice will be created and will be reconciled with the +given payment.

+

It finds a matching invoice for the move_line and reconciles only if the +amount of the payment corresponds or if it is a multiple of the invoice +amount. If many invoices are found, the first reconciled invoice is the +current invoice (last invoice that is not in future). Then it reconciles +the other invoices from last invoice to first.

+

Table of contents

+ +
+

Configuration

+

You can add the following system parameter to enable an analytic account +to be set on exchange rate move lines:

+
    +
  • account_reconcile_compassion.currency_exchange_analytic_account
  • +
+
+
+

Usage

+

To use this module, you need to:

+
    +
  • Go to Accounting -> Bank Statement -> Reconcile
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Compassion CH
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the CompassionCH/compassion-modules project on GitHub.

+

You are welcome to contribute.

+
+
+ + diff --git a/account_reconcile_compassion/static/src/js/account_move_reconciliation.js b/account_reconcile_compassion/static/src/js/account_move_reconciliation.js index 861e45eb3..e49422c1d 100644 --- a/account_reconcile_compassion/static/src/js/account_move_reconciliation.js +++ b/account_reconcile_compassion/static/src/js/account_move_reconciliation.js @@ -56,9 +56,13 @@ odoo.define("account_reconcile_compassion.reconciliation", function (require) { }); reconciliation_renderer.StatementRenderer.include({ - events: _.extend({}, reconciliation_renderer.StatementRenderer.prototype.events, { - "click div:first h1.statement_name": "statementNameClickHandler", - }), + events: _.extend( + {}, + reconciliation_renderer.StatementRenderer.prototype.events, + { + "click div:first h1.statement_name": "statementNameClickHandler", + } + ), // Change behaviour when clicking on name of bank statement statementNameClickHandler: function () { @@ -178,8 +182,8 @@ odoo.define("account_reconcile_compassion.reconciliation", function (require) { account_id: { string: _t("Account"), }, - label: {string: _t("Label")}, - amount: {string: _t("Account")}, + label: { string: _t("Label") }, + amount: { string: _t("Account") }, // CHANGE: Product, sponsorship, user_id and comment // added from original function product_id: { @@ -207,14 +211,14 @@ odoo.define("account_reconcile_compassion.reconciliation", function (require) { self, "account_id", record, - {mode: "edit", attrs: {can_create: false}} + { mode: "edit", attrs: { can_create: false } } ); self.fields.journal_id = new relational_fields.FieldMany2One( self, "journal_id", record, - {mode: "edit"} + { mode: "edit" } ); self.fields.tax_ids = new relational_fields.FieldMany2ManyTags( @@ -223,7 +227,7 @@ odoo.define("account_reconcile_compassion.reconciliation", function (require) { record, { mode: "edit", - additionalContext: {append_type_to_tax_name: true}, + additionalContext: { append_type_to_tax_name: true }, } ); @@ -231,30 +235,40 @@ odoo.define("account_reconcile_compassion.reconciliation", function (require) { self, "analytic_account_id", record, - {mode: "edit"} + { mode: "edit" } ); self.fields.analytic_tag_ids = new relational_fields.FieldMany2ManyTags( self, "analytic_tag_ids", record, - {mode: "edit"} + { mode: "edit" } ); self.fields.force_tax_included = new basic_fields.FieldBoolean( self, "force_tax_included", record, - {mode: "edit"} + { mode: "edit" } ); - self.fields.label = new basic_fields.FieldChar(self, "label", record, { - mode: "edit", - }); + self.fields.label = new basic_fields.FieldChar( + self, + "label", + record, + { + mode: "edit", + } + ); - self.fields.amount = new basic_fields.FieldFloat(self, "amount", record, { - mode: "edit", - }); + self.fields.amount = new basic_fields.FieldFloat( + self, + "amount", + record, + { + mode: "edit", + } + ); self.fields.date = new basic_fields.FieldDate(self, "date", record, { mode: "edit", @@ -264,7 +278,7 @@ odoo.define("account_reconcile_compassion.reconciliation", function (require) { self, "to_check", record, - {mode: "edit"} + { mode: "edit" } ); // CHANGE: Product, sponsorship, user_id and comment @@ -296,9 +310,14 @@ odoo.define("account_reconcile_compassion.reconciliation", function (require) { // } // ); - self.fields.comment = new basic_fields.FieldChar(self, "comment", record, { - mode: "edit", - }); + self.fields.comment = new basic_fields.FieldChar( + self, + "comment", + record, + { + mode: "edit", + } + ); self.fields.avoid_thankyou_letter = new basic_fields.FieldBoolean( self, @@ -325,7 +344,9 @@ odoo.define("account_reconcile_compassion.reconciliation", function (require) { self.fields.journal_id.appendTo( $create.find(".create_journal_id .o_td_field") ); - self.fields.tax_ids.appendTo($create.find(".create_tax_id .o_td_field")); + self.fields.tax_ids.appendTo( + $create.find(".create_tax_id .o_td_field") + ); self.fields.analytic_account_id.appendTo( $create.find(".create_analytic_account_id .o_td_field") ); @@ -342,7 +363,9 @@ odoo.define("account_reconcile_compassion.reconciliation", function (require) { .appendTo($create.find(".create_amount .o_td_field")) .then(addRequiredStyle.bind(self, self.fields.amount)); self.fields.date.appendTo($create.find(".create_date .o_td_field")); - self.fields.to_check.appendTo($create.find(".create_to_check .o_td_field")); + self.fields.to_check.appendTo( + $create.find(".create_to_check .o_td_field") + ); // CHANGE: Product, sponsorship, user_id and comment // added from original function self.fields.product_id.appendTo( @@ -352,7 +375,9 @@ odoo.define("account_reconcile_compassion.reconciliation", function (require) { $create.find(".create_sponsorship_id .o_td_field") ); // self.fields.user_id.appendTo($create.find(".create_user_id .o_td_field")); - self.fields.comment.appendTo($create.find(".create_comment .o_td_field")); + self.fields.comment.appendTo( + $create.find(".create_comment .o_td_field") + ); self.fields.avoid_thankyou_letter.appendTo( $create.find(".create_avoid_thankyou_letter .o_td_field") ); @@ -478,11 +503,14 @@ odoo.define("account_reconcile_compassion.reconciliation", function (require) { if (changes) { if (changes.account_id) values.account_id = changes.account_id; if (changes.tax_id) values.tax_id = changes.tax_id; - if (changes.analytic_id) values.analytic_account_id = changes.analytic_id; + if (changes.analytic_id) + values.analytic_account_id = changes.analytic_id; if (changes.analytic_tag_ids) { // Replace analytic tags as the parent method doesn't support several tags added var line = self.getLine(handle); - var prop = _.last(_.filter(line.reconciliation_proposition, "__focus")); + var prop = _.last( + _.filter(line.reconciliation_proposition, "__focus") + ); prop.analytic_tag_ids = changes.analytic_tag_ids; } } @@ -547,7 +575,9 @@ odoo.define("account_reconcile_compassion.reconciliation", function (require) { _formatToProcessReconciliation: function (line, prop) { var result = this._super(line, prop); result.product_id = prop.product_id ? prop.product_id.id : null; - result.sponsorship_id = prop.sponsorship_id ? prop.sponsorship_id.id : null; + result.sponsorship_id = prop.sponsorship_id + ? prop.sponsorship_id.id + : null; // result.user_id = prop.user_id ? prop.user_id.id : null; result.comment = prop.comment; result.avoid_thankyou_letter = prop.avoid_thankyou_letter diff --git a/account_reconcile_compassion/static/src/js/relational_fields.js b/account_reconcile_compassion/static/src/js/relational_fields.js index afa0bc102..7d0651eb8 100644 --- a/account_reconcile_compassion/static/src/js/relational_fields.js +++ b/account_reconcile_compassion/static/src/js/relational_fields.js @@ -1,4 +1,6 @@ -odoo.define("account_reconcile_compassion.relational_fields", function (require) { +odoo.define("account_reconcile_compassion.relational_fields", function ( + require +) { "use strict"; var FieldMany2One = require("web.relational_fields").FieldMany2One; diff --git a/account_reconcile_compassion/static/src/xml/account_move_reconciliation.xml b/account_reconcile_compassion/static/src/xml/account_move_reconciliation.xml index fcc6247d7..50a2206ae 100644 --- a/account_reconcile_compassion/static/src/xml/account_move_reconciliation.xml +++ b/account_reconcile_compassion/static/src/xml/account_move_reconciliation.xml @@ -1,33 +1,46 @@ - - + - - + + - + - - () + + () -
- +
+ - +
- () + () @@ -35,11 +48,11 @@ Product - + Sponsorship - + @@ -50,11 +63,11 @@ Gift instructions - + Disable thank you letter - + @@ -63,7 +76,8 @@ - Partner name + Partner name diff --git a/account_reconcile_compassion/views/account_invoice_view.xml b/account_reconcile_compassion/views/account_invoice_view.xml index 1af0f7af8..a7c34a5d7 100644 --- a/account_reconcile_compassion/views/account_invoice_view.xml +++ b/account_reconcile_compassion/views/account_invoice_view.xml @@ -1,4 +1,4 @@ - + @@ -6,10 +6,18 @@ account.move - - -