From 41a5411263eb22b222dc438640b8c52799896ff7 Mon Sep 17 00:00:00 2001 From: oca-git-bot Date: Wed, 30 Mar 2022 21:38:04 +0200 Subject: [PATCH] [IMP] update dotfiles --- .copier-answers.yml | 5 +++- .eslintrc.yml | 2 +- .github/workflows/pre-commit.yml | 29 ++++++++++++++----- .pre-commit-config.yaml | 6 ++-- README.md | 6 ++-- .../models/account_asset.py | 2 +- .../report/account_asset_report_xls.py | 2 +- .../tests/test_asset_management_xls.py | 2 +- .../tests/test_check_deposit.py | 4 +-- .../tests/test_journal_lock_date.py | 2 +- .../test_account_move_line_purchase_info.py | 2 +- account_move_line_sale_info/hooks.py | 2 +- .../tests/test_account_move_line_sale_info.py | 2 +- .../test_account_move_template_options.py | 6 ++-- .../tests/test_product_category_tax.py | 6 ++-- 15 files changed, 48 insertions(+), 30 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index c8158f9e9..1dd0be50b 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,14 +1,17 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: v1.3.6 +_commit: v1.5.2 _src_path: gh:oca/oca-addons-repo-template ci: Travis dependency_installation_mode: PIP generate_requirements_txt: true include_wkhtmltopdf: false odoo_version: 14.0 +org_name: Odoo Community Association (OCA) +org_slug: OCA rebel_module_groups: [] repo_description: 'TODO: add repo description.' repo_name: account-financial-tools repo_slug: account-financial-tools +repo_website: https://github.com/OCA/account-financial-tools travis_apt_packages: [] travis_apt_sources: [] diff --git a/.eslintrc.yml b/.eslintrc.yml index d4cc423cc..9429bc688 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -4,7 +4,7 @@ env: # See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449 parserOptions: - ecmaVersion: 2017 + ecmaVersion: 2019 overrides: - files: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 80ab1a211..a7a139046 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -2,7 +2,12 @@ name: pre-commit on: pull_request: + branches: + - "14.0*" push: + branches: + - "14.0" + - "14.0-ocabot-*" jobs: pre-commit: @@ -10,11 +15,21 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 + - name: Get python version + run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV + - uses: actions/cache@v1 with: - # The pylint-odoo version we use here does not support python 3.10 - # https://github.com/OCA/oca-addons-repo-template/issues/80 - # We also need to pin to an older version of python for older odoo versions - # where we are not using black > 21. Older black versions won't work with - # Python 3.9.8+, and we can't bump black without reformatting. - python-version: "3.9.7" - - uses: pre-commit/action@v2.0.0 + 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 + - 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/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9cb8b5118..e450cd13f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,7 +46,7 @@ repos: - --remove-duplicate-keys - --remove-unused-variables - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 22.3.0 hooks: - id: black - repo: https://github.com/pre-commit/mirrors-prettier @@ -120,7 +120,7 @@ repos: name: flake8 additional_dependencies: ["flake8-bugbear==20.1.4"] - repo: https://github.com/PyCQA/pylint - rev: pylint-2.5.3 + rev: v2.11.1 hooks: - id: pylint name: pylint with optional checks @@ -129,7 +129,7 @@ repos: - --exit-zero verbose: true additional_dependencies: &pylint_deps - - pylint-odoo==3.5.0 + - pylint-odoo==5.0.5 - id: pylint name: pylint with mandatory checks args: diff --git a/README.md b/README.md index f09cead7a..c93ba48ef 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -[![Runbot Status](https://runbot.odoo-community.org/runbot/badge/flat/92/14.0.svg)](https://runbot.odoo-community.org/runbot/repo/github-com-oca-account-financial-tools-92) + +[![Runboat](https://img.shields.io/badge/runboat-Try%20me-875A7B.png)](https://runboat.odoo-community.org/builds?repo=OCA/account-financial-tools&target_branch=14.0) [![Build Status](https://travis-ci.com/OCA/account-financial-tools.svg?branch=14.0)](https://travis-ci.com/OCA/account-financial-tools) [![codecov](https://codecov.io/gh/OCA/account-financial-tools/branch/14.0/graph/badge.svg)](https://codecov.io/gh/OCA/account-financial-tools) [![Translation Status](https://translation.odoo-community.org/widgets/account-financial-tools-14-0/-/svg-badge.svg)](https://translation.odoo-community.org/engage/account-financial-tools-14-0/?utm_source=widget) @@ -59,12 +60,11 @@ addon | version | maintainers | summary This repository is licensed under [AGPL-3.0](LICENSE). -However, each module can have a totally different license, as long as they adhere to OCA +However, each module can have a totally different license, as long as they adhere to Odoo Community Association (OCA) policy. Consult each module's `__manifest__.py` file, which contains a `license` key that explains its license. ---- - OCA, or the [Odoo Community Association](http://odoo-community.org/), is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. diff --git a/account_asset_management/models/account_asset.py b/account_asset_management/models/account_asset.py index d39055c51..f6abd6436 100644 --- a/account_asset_management/models/account_asset.py +++ b/account_asset_management/models/account_asset.py @@ -1204,7 +1204,7 @@ class AccountAsset(models.Model): return table def _get_depreciation_entry_name(self, seq): - """ use this method to customise the name of the accounting entry """ + """use this method to customise the name of the accounting entry""" return (self.code or str(self.id)) + "/" + str(seq) def _compute_entries(self, date_end, check_triggers=False): diff --git a/account_asset_management/report/account_asset_report_xls.py b/account_asset_management/report/account_asset_report_xls.py index f7f8db690..d4af7da26 100644 --- a/account_asset_management/report/account_asset_report_xls.py +++ b/account_asset_management/report/account_asset_report_xls.py @@ -392,7 +392,7 @@ class AssetReportXlsx(models.AbstractModel): ws.write_string(row_pos, 0, no_entries, FORMATS["format_left_bold"]) def _get_assets(self, wiz, data): - """ Add the selected assets, both grouped and ungrouped, to `data` """ + """Add the selected assets, both grouped and ungrouped, to `data`""" dom = [ ("date_start", "<=", wiz.date_to), "|", diff --git a/account_asset_management/tests/test_asset_management_xls.py b/account_asset_management/tests/test_asset_management_xls.py index 0b604ff38..a5ed858a7 100644 --- a/account_asset_management/tests/test_asset_management_xls.py +++ b/account_asset_management/tests/test_asset_management_xls.py @@ -71,7 +71,7 @@ class TestAssetManagementXls(AccountTestInvoicingCommon): cls.report_action = cls.xls_report.xls_export() def test_01_action_xls(self): - """ Check report XLS action and generate report """ + """Check report XLS action and generate report""" self.assertGreaterEqual( self.report_action.items(), { diff --git a/account_check_deposit/tests/test_check_deposit.py b/account_check_deposit/tests/test_check_deposit.py index e4b5bf8fc..4f3c3715d 100644 --- a/account_check_deposit/tests/test_check_deposit.py +++ b/account_check_deposit/tests/test_check_deposit.py @@ -141,7 +141,7 @@ class TestPayment(TransactionCase): self.bank_journal.bank_account_id = self.partner_bank_id.id def create_invoice(self, amount=100, inv_type="out_invoice", currency_id=None): - """ Returns an open invoice """ + """Returns an open invoice""" invoice = self.move_model.create( { "company_id": self.main_company.id, @@ -165,7 +165,7 @@ class TestPayment(TransactionCase): return invoice def create_check_deposit(self, move_lines): - """ Returns an validated check deposit """ + """Returns an validated check deposit""" check_deposit = self.check_deposit_model.create( { "company_id": self.main_company.id, diff --git a/account_journal_lock_date/tests/test_journal_lock_date.py b/account_journal_lock_date/tests/test_journal_lock_date.py index a59f63e74..0af81aef7 100644 --- a/account_journal_lock_date/tests/test_journal_lock_date.py +++ b/account_journal_lock_date/tests/test_journal_lock_date.py @@ -154,7 +154,7 @@ class TestJournalLockDate(common.AccountTestInvoicingCommon): move3.action_post() def test_journal_lock_date_adviser(self): - """ The journal lock date is ignored for Advisers """ + """The journal lock date is ignored for Advisers""" self.env.user.write( {"groups_id": [(4, self.env.ref("account.group_account_manager").id)]} ) diff --git a/account_move_line_purchase_info/tests/test_account_move_line_purchase_info.py b/account_move_line_purchase_info/tests/test_account_move_line_purchase_info.py index 3fa83fe47..ea702da08 100644 --- a/account_move_line_purchase_info/tests/test_account_move_line_purchase_info.py +++ b/account_move_line_purchase_info/tests/test_account_move_line_purchase_info.py @@ -61,7 +61,7 @@ class TestAccountMoveLinePurchaseInfo(common.TransactionCase): ) def _create_user(self, login, groups, company): - """ Create a user.""" + """Create a user.""" group_ids = [group.id for group in groups] user = self.res_users_model.with_context({"no_reset_password": True}).create( { diff --git a/account_move_line_sale_info/hooks.py b/account_move_line_sale_info/hooks.py index 46c9f0eb8..86fb30877 100644 --- a/account_move_line_sale_info/hooks.py +++ b/account_move_line_sale_info/hooks.py @@ -4,7 +4,7 @@ def post_init_hook(cr, registry): - """ INIT sale references in acount move line """ + """INIT sale references in acount move line""" # FOR stock moves cr.execute( """ diff --git a/account_move_line_sale_info/tests/test_account_move_line_sale_info.py b/account_move_line_sale_info/tests/test_account_move_line_sale_info.py index d7f6427d2..695668e31 100644 --- a/account_move_line_sale_info/tests/test_account_move_line_sale_info.py +++ b/account_move_line_sale_info/tests/test_account_move_line_sale_info.py @@ -66,7 +66,7 @@ class TestAccountMoveLineSaleInfo(common.TransactionCase): ) def _create_user(self, login, groups, company): - """ Create a user.""" + """Create a user.""" group_ids = [group.id for group in groups] user = self.res_users_model.with_context({"no_reset_password": True}).create( { diff --git a/account_move_template/tests/test_account_move_template_options.py b/account_move_template/tests/test_account_move_template_options.py index e8fc84b7e..a53108142 100644 --- a/account_move_template/tests/test_account_move_template_options.py +++ b/account_move_template/tests/test_account_move_template_options.py @@ -77,7 +77,7 @@ class TestAccountMoveTemplateEnhanced(TransactionCase): ) def test_move_template_normal(self): - """ Test normal case, input amount 300 """ + """Test normal case, input amount 300""" with Form(self.env["account.move.template.run"]) as f: f.template_id = self.move_template template_run = f.save() @@ -103,7 +103,7 @@ class TestAccountMoveTemplateEnhanced(TransactionCase): ) def test_move_template_optional(self): - """ Test optional case, input amount -300, expect optional account """ + """Test optional case, input amount -300, expect optional account""" with Form(self.env["account.move.template.run"]) as f: f.template_id = self.move_template template_run = f.save() @@ -129,7 +129,7 @@ class TestAccountMoveTemplateEnhanced(TransactionCase): ) def test_move_template_overwrite(self): - """ Test case overwrite, amount = 3000, no need to manual input """ + """Test case overwrite, amount = 3000, no need to manual input""" # Test for error when debit is not a valid field with Form(self.env["account.move.template.run"]) as f: f.template_id = self.move_template diff --git a/product_category_tax/tests/test_product_category_tax.py b/product_category_tax/tests/test_product_category_tax.py index b5b4cbe0a..9d1d0b2b6 100644 --- a/product_category_tax/tests/test_product_category_tax.py +++ b/product_category_tax/tests/test_product_category_tax.py @@ -41,7 +41,7 @@ class ProductCategoryTax(common.SavepointCase): ) def test_01_copy_taxes(self): - """ Default taxes taken from the category""" + """Default taxes taken from the category""" test_categ = self.categ_obj.create( { "name": "Super Category", @@ -56,7 +56,7 @@ class ProductCategoryTax(common.SavepointCase): self.assertEqual(self.product_test.supplier_taxes_id, self.tax_purchase) def test_02_update_taxes(self): - """ Default update """ + """Default update""" self.product_test = self.product_obj.create( { "name": "TEST 02", @@ -78,7 +78,7 @@ class ProductCategoryTax(common.SavepointCase): self.assertEqual(self.product_test.supplier_taxes_id, self.tax_purchase) def test_03_taxes_not_updeatable(self): - """ Avoid update specific products""" + """Avoid update specific products""" self.product_test3 = self.product_obj.create( { "name": "TEST 03",