diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index fed88d70d23ecb3297ea28854b320c4d62ee3c26..0000000000000000000000000000000000000000 --- a/.eslintrc.yml +++ /dev/null @@ -1,188 +0,0 @@ -env: - browser: true - es6: true - -# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449 -parserOptions: - ecmaVersion: 2019 - -overrides: - - files: - - "**/*.esm.js" - parserOptions: - sourceType: module - -# Globals available in Odoo that shouldn't produce errorings -globals: - _: readonly - $: readonly - fuzzy: readonly - jQuery: readonly - moment: readonly - 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 -rules: - accessor-pairs: warn - array-callback-return: warn - callback-return: warn - capitalized-comments: - - warn - - always - - ignoreConsecutiveComments: true - ignoreInlineComments: true - complexity: - - warn - - 15 - constructor-super: warn - dot-notation: warn - eqeqeq: warn - global-require: warn - handle-callback-err: warn - id-blacklist: warn - id-match: warn - init-declarations: error - max-depth: warn - max-nested-callbacks: warn - max-statements-per-line: warn - no-alert: warn - no-array-constructor: warn - no-caller: warn - no-case-declarations: warn - no-class-assign: warn - no-cond-assign: error - no-const-assign: error - no-constant-condition: warn - no-control-regex: warn - no-debugger: error - no-delete-var: warn - no-div-regex: warn - no-dupe-args: error - no-dupe-class-members: error - no-dupe-keys: error - no-duplicate-case: error - no-duplicate-imports: error - no-else-return: warn - no-empty-character-class: warn - no-empty-function: error - no-empty-pattern: error - no-empty: warn - no-eq-null: error - no-eval: error - no-ex-assign: error - no-extend-native: warn - no-extra-bind: warn - no-extra-boolean-cast: warn - no-extra-label: warn - no-fallthrough: warn - no-func-assign: error - no-global-assign: error - no-implicit-coercion: - - warn - - allow: ["~"] - no-implicit-globals: warn - no-implied-eval: warn - no-inline-comments: warn - no-inner-declarations: warn - no-invalid-regexp: warn - no-irregular-whitespace: warn - no-iterator: warn - no-label-var: warn - no-labels: warn - no-lone-blocks: warn - no-lonely-if: error - no-mixed-requires: error - no-multi-str: warn - no-native-reassign: error - no-negated-condition: warn - no-negated-in-lhs: error - no-new-func: warn - no-new-object: warn - no-new-require: warn - no-new-symbol: warn - no-new-wrappers: warn - no-new: warn - no-obj-calls: warn - no-octal-escape: warn - no-octal: warn - no-param-reassign: warn - no-path-concat: warn - no-process-env: warn - no-process-exit: warn - no-proto: warn - no-prototype-builtins: warn - no-redeclare: warn - no-regex-spaces: warn - no-restricted-globals: warn - no-restricted-imports: warn - no-restricted-modules: warn - no-restricted-syntax: warn - no-return-assign: error - no-script-url: warn - no-self-assign: warn - no-self-compare: warn - no-sequences: warn - no-shadow-restricted-names: warn - no-shadow: warn - no-sparse-arrays: warn - no-sync: warn - no-this-before-super: warn - no-throw-literal: warn - no-undef-init: warn - no-undef: error - no-unmodified-loop-condition: warn - no-unneeded-ternary: error - no-unreachable: error - no-unsafe-finally: error - no-unused-expressions: error - no-unused-labels: error - no-unused-vars: error - no-use-before-define: error - no-useless-call: warn - no-useless-computed-key: warn - no-useless-concat: warn - no-useless-constructor: warn - no-useless-escape: warn - no-useless-rename: warn - no-void: warn - no-with: warn - operator-assignment: [error, always] - prefer-const: warn - radix: warn - require-yield: warn - sort-imports: warn - spaced-comment: [error, always] - strict: [error, function] - use-isnan: error - valid-jsdoc: - - warn - - prefer: - arg: param - argument: param - augments: extends - constructor: class - exception: throws - func: function - method: function - prop: property - return: returns - virtual: abstract - yield: yields - preferType: - array: Array - bool: Boolean - boolean: Boolean - number: Number - object: Object - str: String - string: String - requireParamDescription: false - requireReturn: false - requireReturnDescription: false - requireReturnType: false - valid-typeof: warn - yoda: warn diff --git a/.gitignore b/.gitignore index d99361a24aa02c2d19d8165c3a057b84bc575166..109270f27c2a80740fab3c0fbc084b9d938f964e 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,19 @@ var/ *.eggs .copier-answers.yml +# Windows installers +*.msi + +# Debian packages +*.deb + +# Redhat packages +*.rpm + +# MacOS packages +*.dmg +*.pkg + # Installer logs pip-log.txt pip-delete-this-directory.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3efb4d9157dc36d84e372eec5fc21e7f4a417a58..207e4c9037d15863a1efcc9bd98b6199792df472 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ exclude: | # 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/| + .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|^eslint.config.cjs|^prettier.config.cjs| # Maybe reactivate this when all README files include prettier ignore tags? ^README\.md$| # Library files can have extraneous formatting (even minimized) @@ -16,11 +16,13 @@ exclude: | 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: python: python3 - node: "16.17.0" + node: "22.9.0" repos: - repo: local hooks: @@ -37,46 +39,50 @@ repos: language: fail files: '[a-zA-Z0-9_]*/i18n/en\.po$' - repo: https://github.com/oca/maintainer-tools - rev: f71041f22b8cd68cf7c77b73a14ca8d8cd190a60 + rev: bf9ecb9938b6a5deca0ff3d870fbd3f33341fded 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"] - - id: oca-gen-addon-readme - args: - - --addons-dir=. - - --branch=16.0 - - --org-name=lefilament - - --repo-name=template_module - - --if-source-changed - - --keep-source-digest - repo: https://github.com/OCA/odoo-pre-commit-hooks - rev: v0.0.25 + rev: v0.0.33 hooks: - id: oca-checks-odoo-module - id: oca-checks-po - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.7.1 + args: + - --disable=po-pretty-format + - repo: local hooks: - id: prettier name: prettier (with plugin-xml) - additional_dependencies: - - "prettier@2.7.1" - - "@prettier/plugin-xml@2.2.0" + entry: prettier args: - - --plugin=@prettier/plugin-xml + - --write + - --list-different + - --ignore-unknown + types: [text] files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$ - - repo: https://github.com/pre-commit/mirrors-eslint - rev: v8.24.0 + language: node + additional_dependencies: + - "prettier@3.3.3" + - "@prettier/plugin-xml@3.4.1" + - repo: local hooks: - id: eslint - verbose: true + name: eslint + entry: eslint args: - --color - --fix + verbose: true + types: [javascript] + language: node + additional_dependencies: + - "eslint@9.12.0" + - "eslint-plugin-jsdoc@50.3.1" - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.6.0 hooks: - id: trailing-whitespace # exclude autogenerated files @@ -98,13 +104,13 @@ repos: - id: mixed-line-ending args: ["--fix=lf"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.3 + rev: v0.6.8 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/OCA/pylint-odoo - rev: v8.0.19 + rev: v9.1.3 hooks: - id: pylint_odoo name: pylint with optional checks diff --git a/.pylintrc b/.pylintrc index 71c476d4f10ac08a7333729b93705c9573d240d5..b855a9270efdb66248c84038041d1a589961ee44 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=18.0 [MESSAGES CONTROL] disable=all diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory index 99064933ef82c469ba5fda5b2904447c05c99dbe..f9450512a1b688db0b671c400b492ac9e4e2e425 100644 --- a/.pylintrc-mandatory +++ b/.pylintrc-mandatory @@ -9,7 +9,7 @@ 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 +valid-odoo-versions=18.0 [MESSAGES CONTROL] disable=all diff --git a/.ruff.toml b/.ruff.toml index 0240c75f6a4ae4550f3473ad0a5faaef022bf6c7..0f1e35f24803bf777951495f745cb2f1630cb4cb 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -15,16 +15,16 @@ exclude = ["setup/*"] [format] exclude = ["setup/*"] -[per-file-ignores] +[lint.per-file-ignores] "__init__.py" = ["F401", "I001"] # ignore unused and unsorted imports in __init__.py "__manifest__.py" = ["B018"] # useless expression -[isort] +[lint.isort] section-order = ["future", "standard-library", "third-party", "odoo", "odoo-addons", "first-party", "local-folder"] -[isort.sections] +[lint.isort.sections] "odoo" = ["odoo"] "odoo-addons" = ["odoo.addons"] -[mccabe] +[lint.mccabe] max-complexity = 16 diff --git a/__manifest__.py b/__manifest__.py index 2f2258d69ca26995363e55a18000a8b6f320d57e..e385ff528bb1a6d1c4d1913a1d862cc8d2505894 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -3,7 +3,7 @@ "summary": "Gestion des contrats des outils financiers", "author": "Le Filament", "website": "https://le-filament.com", - "version": "16.0.1.0.0", + "version": "18.0.1.0.0", "license": "AGPL-3", "depends": [ "contacts", @@ -20,6 +20,7 @@ "views/financial_product_category.xml", "views/financial_product_template.xml", "views/financial_suspensive_condition.xml", + "views/res_config_settings.xml", # views menu "views/menus.xml", # wizard diff --git a/eslint.config.cjs b/eslint.config.cjs new file mode 100644 index 0000000000000000000000000000000000000000..0d5731f89a8bc2073894c17dfe41e410db0e4cfe --- /dev/null +++ b/eslint.config.cjs @@ -0,0 +1,202 @@ +jsdoc = require("eslint-plugin-jsdoc"); + +const config = [{ + plugins: { + jsdoc, + }, + + languageOptions: { + globals: { + _: "readonly", + $: "readonly", + fuzzy: "readonly", + jQuery: "readonly", + moment: "readonly", + odoo: "readonly", + openerp: "readonly", + owl: "readonly", + luxon: "readonly", + }, + + ecmaVersion: 2024, + sourceType: "script", + }, + + rules: { + "accessor-pairs": "warn", + "array-callback-return": "warn", + "callback-return": "warn", + "capitalized-comments": ["warn", "always", { + ignoreConsecutiveComments: true, + ignoreInlineComments: true, + }], + complexity: ["warn", 15], + "constructor-super": "warn", + "dot-notation": "warn", + eqeqeq: "warn", + "global-require": "warn", + "handle-callback-err": "warn", + "id-blacklist": "warn", + "id-match": "warn", + "init-declarations": "error", + "max-depth": "warn", + "max-nested-callbacks": "warn", + "max-statements-per-line": "warn", + "no-alert": "warn", + "no-array-constructor": "warn", + "no-caller": "warn", + "no-case-declarations": "warn", + "no-class-assign": "warn", + "no-cond-assign": "error", + "no-const-assign": "error", + "no-constant-condition": "warn", + "no-control-regex": "warn", + "no-debugger": "error", + "no-delete-var": "warn", + "no-div-regex": "warn", + "no-dupe-args": "error", + "no-dupe-class-members": "error", + "no-dupe-keys": "error", + "no-duplicate-case": "error", + "no-duplicate-imports": "error", + "no-else-return": "warn", + "no-empty-character-class": "warn", + "no-empty-function": "error", + "no-empty-pattern": "error", + "no-empty": "warn", + "no-eq-null": "error", + "no-eval": "error", + "no-ex-assign": "error", + "no-extend-native": "warn", + "no-extra-bind": "warn", + "no-extra-boolean-cast": "warn", + "no-extra-label": "warn", + "no-fallthrough": "warn", + "no-func-assign": "error", + "no-global-assign": "error", + "no-implicit-coercion": ["warn", { + allow: ["~"], + }], + "no-implicit-globals": "warn", + "no-implied-eval": "warn", + "no-inline-comments": "warn", + "no-inner-declarations": "warn", + "no-invalid-regexp": "warn", + "no-irregular-whitespace": "warn", + "no-iterator": "warn", + "no-label-var": "warn", + "no-labels": "warn", + "no-lone-blocks": "warn", + "no-lonely-if": "error", + "no-mixed-requires": "error", + "no-multi-str": "warn", + "no-native-reassign": "error", + "no-negated-condition": "warn", + "no-negated-in-lhs": "error", + "no-new-func": "warn", + "no-new-object": "warn", + "no-new-require": "warn", + "no-new-symbol": "warn", + "no-new-wrappers": "warn", + "no-new": "warn", + "no-obj-calls": "warn", + "no-octal-escape": "warn", + "no-octal": "warn", + "no-param-reassign": "warn", + "no-path-concat": "warn", + "no-process-env": "warn", + "no-process-exit": "warn", + "no-proto": "warn", + "no-prototype-builtins": "warn", + "no-redeclare": "warn", + "no-regex-spaces": "warn", + "no-restricted-globals": "warn", + "no-restricted-imports": "warn", + "no-restricted-modules": "warn", + "no-restricted-syntax": "warn", + "no-return-assign": "error", + "no-script-url": "warn", + "no-self-assign": "warn", + "no-self-compare": "warn", + "no-sequences": "warn", + "no-shadow-restricted-names": "warn", + "no-shadow": "warn", + "no-sparse-arrays": "warn", + "no-sync": "warn", + "no-this-before-super": "warn", + "no-throw-literal": "warn", + "no-undef-init": "warn", + "no-undef": "error", + "no-unmodified-loop-condition": "warn", + "no-unneeded-ternary": "error", + "no-unreachable": "error", + "no-unsafe-finally": "error", + "no-unused-expressions": "error", + "no-unused-labels": "error", + "no-unused-vars": "error", + "no-use-before-define": "error", + "no-useless-call": "warn", + "no-useless-computed-key": "warn", + "no-useless-concat": "warn", + "no-useless-constructor": "warn", + "no-useless-escape": "warn", + "no-useless-rename": "warn", + "no-void": "warn", + "no-with": "warn", + "operator-assignment": ["error", "always"], + "prefer-const": "warn", + radix: "warn", + "require-yield": "warn", + "sort-imports": "warn", + "spaced-comment": ["error", "always"], + strict: ["error", "function"], + "use-isnan": "error", + + "jsdoc/check-tag-names": "warn", + "jsdoc/check-types": "warn", + "jsdoc/require-param-description": "off", + "jsdoc/require-return": "off", + "jsdoc/require-return-description": "off", + "jsdoc/require-return-type": "off", + + "valid-typeof": "warn", + yoda: "warn", + }, + + settings: { + jsdoc: { + tagNamePreference: { + arg: "param", + argument: "param", + augments: "extends", + constructor: "class", + exception: "throws", + func: "function", + method: "function", + prop: "property", + return: "returns", + virtual: "abstract", + yield: "yields", + }, + preferredTypes: { + array: "Array", + bool: "Boolean", + boolean: "Boolean", + number: "Number", + object: "Object", + str: "String", + string: "String", + }, + }, + }, + +}, { + files: ["**/*.esm.js"], + + languageOptions: { + ecmaVersion: 2024, + sourceType: "module", + }, +}]; + +module.exports = config diff --git a/models/financial_contract.py b/models/financial_contract.py index db60f305fe57a10767a8d202015968a709c9f7ef..1de71f81c4833e41a8dbe31a3582a394963d8b80 100644 --- a/models/financial_contract.py +++ b/models/financial_contract.py @@ -9,6 +9,7 @@ class FinancialContract(models.AbstractModel): _name = "financial.contract" _description = "Financial Contract" _order = "create_date desc" + _check_company_auto = True name = fields.Char(compute="_compute_name") number = fields.Char("Numéro", readonly=True) @@ -95,7 +96,7 @@ class FinancialContract(models.AbstractModel): for contract in self: if contract.state != "init": raise UserError( - _("Seuls les deals à l'état Projet peuvent être supprimés") + _("Seuls les contrats à l'état Initialisation peuvent être supprimés") ) return super().unlink() diff --git a/models/financial_product_template.py b/models/financial_product_template.py index 234207db3c846652ff658496af5be0cbd3300b66..812bc5cd841393d4fff81f17f68802f0cbf870ad 100644 --- a/models/financial_product_template.py +++ b/models/financial_product_template.py @@ -8,12 +8,14 @@ from odoo.exceptions import UserError class FinancialProductTemplate(models.AbstractModel): _name = "financial.product.template" _description = "Financial product template" + _check_company_auto = True name = fields.Char(required=True) category_id = fields.Many2one( comodel_name="financial.product.category", string="Nom de la gamme", required=True, + check_company=True, ondelete="restrict", ) active = fields.Boolean( diff --git a/prettier.config.cjs b/prettier.config.cjs new file mode 100644 index 0000000000000000000000000000000000000000..e66cd82cc1e4dfeded9749598144f820c8491fab --- /dev/null +++ b/prettier.config.cjs @@ -0,0 +1,14 @@ +/** @type {import('prettier').Config} */ + +const config = { + // https://github.com/prettier/prettier/issues/15388#issuecomment-1717746872 + plugins: [require.resolve("@prettier/plugin-xml")], + bracketSpacing: false, + printWidth: 88, + proseWrap: "always", + semi: true, + trailingComma: "es5", + xmlWhitespaceSensitivity: "preserve", +}; + +module.exports = config; diff --git a/views/financial_contract.xml b/views/financial_contract.xml index b68a85a07010a61dfc69d96a7ebec9c0fdeb260f..f2e239e990aba35d55b0639e325a0f0511879856 100644 --- a/views/financial_contract.xml +++ b/views/financial_contract.xml @@ -2,15 +2,15 @@ <odoo> <!-- Tree --> <record id="financial_contract_tree_view" model="ir.ui.view"> - <field name="name">financial.contract.tree</field> + <field name="name">financial.contract.list</field> <field name="model">financial.contract</field> <field name="arch" type="xml"> - <tree create="0" edit="0" delete="0"> + <list create="0" edit="0" delete="0"> <field name="partner_id" /> <field name="amount" string="Montant" /> <field name="company_id" /> <field name="currency_id" invisible="1" /> - </tree> + </list> </field> </record> @@ -20,6 +20,9 @@ <field name="model">financial.contract</field> <field name="arch" type="xml"> <form> + <header> + <field name="state" widget="statusbar" options="{'clickable': '1'}" /> + </header> <sheet> <group> <group name="contract_data" string="Contrat"> @@ -35,8 +38,11 @@ <field name="amount" string="Montant emprunté" /> </group> </group> - <separator string="Description" /> - <field name="comment" /> + <notebook> + <page name="comment" string="Description"> + <field name="comment"/> + </page> + </notebook> </sheet> </form> </field> diff --git a/views/financial_external_guarantee.xml b/views/financial_external_guarantee.xml index 1e6e22a2c7ab2c599831079779a79263a1536b77..98d91dd6b2cad59cddd15cc95dcc7bd2c3d40a90 100644 --- a/views/financial_external_guarantee.xml +++ b/views/financial_external_guarantee.xml @@ -4,13 +4,13 @@ <odoo> <!-- Tree --> <record model="ir.ui.view" id="financial_external_guarantee_tree_view"> - <field name="name">financial.external.guarantee.tree</field> + <field name="name">financial.external.guarantee.list</field> <field name="model">financial.external.guarantee</field> <field name="arch" type="xml"> - <tree editable="top"> + <list editable="top"> <field name="name" /> <field name="active" invisible="1" /> - </tree> + </list> </field> </record> @@ -21,6 +21,6 @@ > <field name="name">Garantie</field> <field name="res_model">financial.external.guarantee</field> - <field name="view_mode">tree</field> + <field name="view_mode">list</field> </record> </odoo> diff --git a/views/financial_funding.xml b/views/financial_funding.xml index b28be3d18f756227de7ba0941ea474d694de3384..9b02c11d06cdf41be6f87ac58fc5c9373dd207a8 100644 --- a/views/financial_funding.xml +++ b/views/financial_funding.xml @@ -4,13 +4,13 @@ <odoo> <!-- Tree --> <record model="ir.ui.view" id="financial_funding_tree_view"> - <field name="name">financial.funding.tree</field> + <field name="name">financial.funding.list</field> <field name="model">financial.funding</field> <field name="arch" type="xml"> - <tree editable="top"> + <list editable="top"> <field name="name" /> <field name="active" invisible="1" /> - </tree> + </list> </field> </record> @@ -18,6 +18,6 @@ <record model="ir.actions.act_window" id="financial_funding_act_window"> <field name="name">Fonds financeur</field> <field name="res_model">financial.funding</field> - <field name="view_mode">tree</field> + <field name="view_mode">list</field> </record> </odoo> diff --git a/views/financial_product_category.xml b/views/financial_product_category.xml index 02ce8a91e30d5a818b25b60484b3c9a2d7674db2..e68e242999182821e87fdf3c283d9f63bfa17616 100644 --- a/views/financial_product_category.xml +++ b/views/financial_product_category.xml @@ -25,14 +25,14 @@ <!-- Tree --> <record model="ir.ui.view" id="financial_product_category_tree_view"> - <field name="name">financial.product.category.tree</field> + <field name="name">financial.product.category.list</field> <field name="model">financial.product.category</field> <field name="arch" type="xml"> - <tree> + <list> <field name="name" /> <field name="active" invisible="1" /> <field name="company_id" /> - </tree> + </list> </field> </record> @@ -48,7 +48,7 @@ name="web_ribbon" title="Archived" bg_color="bg-danger" - attrs="{'invisible': [('active', '=', True)]}" + invisible="active" /> <!-- Title --> <div class="oe_title"> @@ -80,6 +80,6 @@ > <field name="name">Gammes de produits</field> <field name="res_model">financial.product.category</field> - <field name="view_mode">tree,form</field> + <field name="view_mode">list,form</field> </record> </odoo> diff --git a/views/financial_product_template.xml b/views/financial_product_template.xml index ba95a6e420c016c415a5ebfd061c8797e4dee1de..f5d918fe90adc9bd15df3dfce2b58632598bcc5d 100644 --- a/views/financial_product_template.xml +++ b/views/financial_product_template.xml @@ -2,10 +2,10 @@ <odoo> <!-- Tree --> <record id="financial_product_template_tree_view" model="ir.ui.view"> - <field name="name">financial.product.template.tree</field> + <field name="name">financial.product.template.list</field> <field name="model">financial.product.template</field> <field name="arch" type="xml"> - <tree create="0" edit="0" delete="0"> + <list create="0" edit="0" delete="0"> <field name="name" /> <field name="category_id" /> <field name="date_start" /> @@ -15,7 +15,7 @@ options="{'no_create': 1, 'no_edit': 1}" /> <field name="currency_id" invisible="1" /> - </tree> + </list> </field> </record> @@ -32,7 +32,7 @@ name="web_ribbon" title="Archived" bg_color="bg-danger" - attrs="{'invisible': [('active', '=', True)]}" + invisible="active" /> <!-- Title --> <div class="oe_title"> diff --git a/views/financial_suspensive_condition.xml b/views/financial_suspensive_condition.xml index 85af4e4d30924b886f212811562c86c5e0c9c3dc..68343d89340fad3cf79710c8074e81111a8daf3d 100644 --- a/views/financial_suspensive_condition.xml +++ b/views/financial_suspensive_condition.xml @@ -4,13 +4,13 @@ <odoo> <!-- Tree --> <record model="ir.ui.view" id="financial_suspensive_condition_tree_view"> - <field name="name">financial.suspensive.condition.tree</field> + <field name="name">financial.suspensive.condition.list</field> <field name="model">financial.suspensive.condition</field> <field name="arch" type="xml"> - <tree editable="top"> + <list editable="top"> <field name="name" /> <field name="active" invisible="1" /> - </tree> + </list> </field> </record> @@ -21,6 +21,6 @@ > <field name="name">Conditions suspensives</field> <field name="res_model">financial.suspensive.condition</field> - <field name="view_mode">tree</field> + <field name="view_mode">list</field> </record> </odoo> diff --git a/views/menus.xml b/views/menus.xml index aa204eb1dfbd25b4340ec3aae195ea9d45edd0ec..128dc2dcd32f876a7179081b9c06b95237148ede 100644 --- a/views/menus.xml +++ b/views/menus.xml @@ -23,6 +23,13 @@ parent="financial_contract_menu_root" sequence="100" /> + <menuitem + id="menu_training_settings" + name="Paramètres" + sequence="100" + parent="menu_financial_contract_configuration" + action="action_financial_contract_config" + /> <menuitem id="menu_financial_product_category" name="Gammes de produits" diff --git a/views/res_config_settings.xml b/views/res_config_settings.xml new file mode 100644 index 0000000000000000000000000000000000000000..c6d2c8f34d0e80c8133aa6c6897427d8c4139fed --- /dev/null +++ b/views/res_config_settings.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8" ?> +<odoo> + <record id="res_config_settings_financial_contract_view_form" model="ir.ui.view"> + <field name="name">res.config.settings.view.financial.contract_form.inherit</field> + <field name="model">res.config.settings</field> + <field name="priority" eval="40" /> + <field name="inherit_id" ref="base.res_config_settings_view_form" /> + <field name="arch" type="xml"> + <xpath expr="//form" position="inside"> + <app + data-string="Contrats financiers" + string="Contrats financiers" + name="financial_contract" + groups="financial_contract.group_financial_admin" + > + </app> + </xpath> + </field> + </record> + + <record id="action_financial_contract_config" model="ir.actions.act_window"> + <field name="name">Settings</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">res.config.settings</field> + <field name="view_mode">form</field> + <field name="target">inline</field> + <field name="context">{'module' : 'financial_contract', 'bin_size': False}</field> + </record> +</odoo>