From ce70cbe9593c4350b41c8e4a1142388a577a2b19 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20-=20Le=20Filament?= <remi@le-filament.com>
Date: Sun, 29 Sep 2024 16:54:48 +0200
Subject: [PATCH] [MIG] version 17.0

---
 .eslintrc.yml           |  3 +-
 .gitignore              | 11 +++++++
 .pre-commit-config.yaml | 66 ++++++++++++++++++++---------------------
 .pylintrc               | 12 ++++----
 .pylintrc-mandatory     | 12 ++++----
 .ruff.toml              | 30 +++++++++++++++++++
 README.rst              |  3 +-
 __manifest__.py         |  4 +--
 i18n/fr.po              |  2 +-
 9 files changed, 91 insertions(+), 52 deletions(-)
 create mode 100644 .ruff.toml

diff --git a/.eslintrc.yml b/.eslintrc.yml
index 9429bc6..0b38203 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: 2019
+  ecmaVersion: 2022
 
 overrides:
   - files:
@@ -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/.gitignore b/.gitignore
index 9c283fd..c9f4238 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@ __pycache__/
 *.py[cod]
 /.venv
 /.pytest_cache
+/.ruff_cache
 
 # C extensions
 *.so
@@ -23,6 +24,16 @@ var/
 .installed.cfg
 *.egg
 *.eggs
+.copier-answers.yml
+
+# Debian packages
+*.deb
+
+# Redhat packages
+*.rpm
+
+# MacOS packages
+*.dmg
 
 # Installer logs
 pip-log.txt
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index c575299..f58f2c6 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -12,6 +12,12 @@ exclude: |
   /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/|
+  # Ignore test files in addons
+  /tests/samples/.*|
   # You don't usually want a bot to modify your legal texts
   (LICENSE.*|COPYING.*)
 default_language_version:
@@ -31,29 +37,34 @@ repos:
         name: en.po files cannot exist
         entry: found a en.po file
         language: fail
-        files: '[a-zA-Z0-9_]*/i18n/en\.po$'
+        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: 4cd2b852214dead80822e93e6749b16f2785b2fe
+    rev: d5fab7ee87fceee858a3d01048c78a548974d935
     hooks:
       # update the NOT INSTALLABLE ADDONS section above
       - id: oca-update-pre-commit-excluded-addons
       - id: oca-fix-manifest-website
         args: ["https://le-filament.com"]
-  - repo: https://github.com/myint/autoflake
-    rev: v1.6.1
-    hooks:
-      - id: autoflake
+      - id: oca-gen-addon-readme
         args:
-          - --expand-star-imports
-          - --ignore-init-module-imports
-          - --in-place
-          - --remove-all-unused-imports
-          - --remove-duplicate-keys
-          - --remove-unused-variables
-  - repo: https://github.com/psf/black
-    rev: 22.8.0
+          - --addons-dir=.
+          - --branch=17.0
+          - --org-name=lefilament
+          - --repo-name=template_module
+          - --if-source-changed
+          - --keep-source-digest
+          - --convert-fragments-to-markdown
+      # - id: oca-gen-external-dependencies
+  - repo: https://github.com/OCA/odoo-pre-commit-hooks
+    rev: v0.0.25
     hooks:
-      - id: black
+      - id: oca-checks-odoo-module
+      - id: oca-checks-po
   - repo: https://github.com/pre-commit/mirrors-prettier
     rev: v2.7.1
     hooks:
@@ -95,27 +106,14 @@ repos:
       - id: check-xml
       - id: mixed-line-ending
         args: ["--fix=lf"]
-  - repo: https://github.com/asottile/pyupgrade
-    rev: v2.38.2
-    hooks:
-      - id: pyupgrade
-        args: ["--keep-percent-format"]
-  - repo: https://github.com/PyCQA/isort
-    rev: 5.10.1
-    hooks:
-      - id: isort
-        name: isort except __init__.py
-        args:
-          - --settings=.
-        exclude: /__init__\.py$
-  - repo: https://gitlab.com/PyCQA/flake8
-    rev: 3.9.2
+  - repo: https://github.com/astral-sh/ruff-pre-commit
+    rev: v0.1.3
     hooks:
-      - id: flake8
-        name: flake8
-        additional_dependencies: ["flake8-bugbear==21.9.2"]
+      - id: ruff
+        args: [--fix, --exit-non-zero-on-fix]
+      - id: ruff-format
   - repo: https://github.com/OCA/pylint-odoo
-    rev: 7.0.2
+    rev: v9.0.4
     hooks:
       - id: pylint_odoo
         name: pylint with optional checks
diff --git a/.pylintrc b/.pylintrc
index 71c476d..4fb9ba5 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -5,12 +5,12 @@ 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=Le Filament
-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=16.0
+readme-template-url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
+manifest-required-authors=Le Filament
+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
diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory
index ed2c217..42885e9 100644
--- a/.pylintrc-mandatory
+++ b/.pylintrc-mandatory
@@ -4,12 +4,12 @@ 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=Le Filament
-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=16.0
+readme-template-url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
+manifest-required-authors=Le Filament
+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
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.rst b/README.rst
index 9841b49..5401f71 100644
--- a/README.rst
+++ b/README.rst
@@ -11,8 +11,7 @@ This module depends upon *account* module.
 
 This module provides:
 
-* Updated account invoice form view to add a confirmation popup  befor validation
-* Updated account invoice tree view to display untaxed amount
+* Updated account invoice form view to add a confirmation popup before validation
 
 
 Credits
diff --git a/__manifest__.py b/__manifest__.py
index 5190b3c..db4e55b 100644
--- a/__manifest__.py
+++ b/__manifest__.py
@@ -1,7 +1,7 @@
 {
     "name": "Le Filament - Account",
-    "summary": "Generic Account Invoice views update by Le Filament",
-    "version": "16.0.1.0.0",
+    "summary": "Confirm account move validation",
+    "version": "17.0.1.0.0",
     "license": "AGPL-3",
     "author": "Le Filament",
     "category": "Accounting/Accounting",
diff --git a/i18n/fr.po b/i18n/fr.po
index 17ddd65..e6d0e7f 100644
--- a/i18n/fr.po
+++ b/i18n/fr.po
@@ -4,7 +4,7 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Odoo Server 15.0\n"
+"Project-Id-Version: Odoo Server 17.0\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2022-11-10 08:27+0000\n"
 "PO-Revision-Date: 2022-11-10 08:27+0000\n"
-- 
GitLab