diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1c6434bfc2274c73d98dbf62b6de9baccdc353ce..4acca684ec8c5cda7b3ecd21b9e568ab03d57e8c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,6 +27,11 @@ repos: 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: ab1d7f6 hooks: @@ -46,7 +51,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 @@ -96,32 +101,28 @@ repos: - id: pyupgrade args: ["--keep-percent-format"] - repo: https://github.com/PyCQA/isort - rev: 5.5.1 + rev: 5.12.0 hooks: - id: isort name: isort except __init__.py args: - --settings=. exclude: /__init__\.py$ - - repo: https://gitlab.com/PyCQA/flake8 + - repo: https://github.com/PyCQA/flake8 rev: 3.8.3 hooks: - id: flake8 name: flake8 additional_dependencies: ["flake8-bugbear==20.1.4"] - - repo: https://github.com/PyCQA/pylint - rev: pylint-2.5.3 + - repo: https://github.com/OCA/pylint-odoo + rev: 7.0.2 hooks: - - id: pylint + - id: pylint_odoo name: pylint with optional checks args: - --rcfile=.pylintrc - --exit-zero verbose: true - additional_dependencies: &pylint_deps - - pylint-odoo==3.5.0 - - id: pylint - name: pylint with mandatory checks + - id: pylint_odoo args: - --rcfile=.pylintrc-mandatory - additional_dependencies: *pylint_deps diff --git a/models/res_partner.py b/models/res_partner.py index 4604a60007d28800b9a9105df83b13931598fdf7..427f7e5d2cacd0f88fb9572f8b61b62ef2884212 100644 --- a/models/res_partner.py +++ b/models/res_partner.py @@ -110,8 +110,7 @@ class ScopAlfrescoAdhesionPartner(models.Model): compulsory_docs = self.get_compulsory_docs(type_process) loaded_docs = self.compulsory_doc_cmis_query() - errors_complete_docs = self.check_compulsory_docs( - compulsory_docs, loaded_docs) + errors_complete_docs = self.check_compulsory_docs(compulsory_docs, loaded_docs) if errors_complete_docs: errors_str = str() for error in errors_complete_docs: @@ -123,10 +122,15 @@ class ScopAlfrescoAdhesionPartner(models.Model): if errors: local_tz = timezone("Europe/Paris") utc_tz = timezone("UTC") - log_date = utc_tz.localize( - fields.Datetime.now()).astimezone(local_tz).strftime("%d/%m/%Y %-H:%M") + log_date = ( + utc_tz.localize(fields.Datetime.now()) + .astimezone(local_tz) + .strftime("%d/%m/%Y %-H:%M") + ) self.list_logs = "<strong>%s</strong> %s %s" % ( - log_date, error_type, errors + log_date, + error_type, + errors, ) else: self.list_logs = False