diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..bfd7ac53df9f103f6dc8853738c63fd364445fde --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +# Configuration for known file extensions +[*.{css,js,json,less,md,py,rst,sass,scss,xml,yaml,yml}] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{json,yml,yaml,rst,md}] +indent_size = 2 + +# Do not configure editor for libs and autogenerated content +[{*/static/{lib,src/lib}/**,*/static/description/index.html,*/readme/../README.rst}] +charset = unset +end_of_line = unset +indent_size = unset +indent_style = unset +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 0000000000000000000000000000000000000000..88f2881b4c128fc4762338a8f420272c44cc29ef --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,180 @@ +env: + browser: true + +# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449 +parserOptions: + ecmaVersion: 2017 + +# Globals available in Odoo that shouldn't produce errorings +globals: + _: readonly + $: readonly + fuzzy: readonly + jQuery: readonly + moment: readonly + odoo: readonly + openerp: readonly + Promise: 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/.flake8 b/.flake8 new file mode 100644 index 0000000000000000000000000000000000000000..e397e8ed4e3e7f7fe7785dd391bb80aa6d85575e --- /dev/null +++ b/.flake8 @@ -0,0 +1,12 @@ +[flake8] +max-line-length = 88 +max-complexity = 16 +# B = bugbear +# B9 = bugbear opinionated (incl line length) +select = C,E,F,W,B,B9 +# E203: whitespace before ':' (black behaviour) +# E501: flake8 line length (covered by bugbear B950) +# W503: line break before binary operator (black behaviour) +ignore = E203,E501,W503 +per-file-ignores= + __init__.py:F401 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..818770fb1bdc0a144e924c9a5940f0b035df8a0d --- /dev/null +++ b/.gitignore @@ -0,0 +1,75 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +/.venv +/.pytest_cache + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +bin/ +build/ +develop-eggs/ +dist/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg +*.eggs + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo + +# Pycharm +.idea + +# Eclipse +.settings + +# Visual Studio cache/options directory +.vs/ +.vscode + +# OSX Files +.DS_Store + +# Django stuff: +*.log + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject + +# Rope +.ropeproject + +# Sphinx documentation +docs/_build/ + +# Backup files +*~ +*.swp + +# OCA rules +!static/lib/ diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000000000000000000000000000000000000..0ec187efd1bf802844749f508cda0c8f138970f9 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,13 @@ +[settings] +; see https://github.com/psf/black +multi_line_output=3 +include_trailing_comma=True +force_grid_wrap=0 +combine_as_imports=True +use_parentheses=True +line_length=88 +known_odoo=odoo +known_odoo_addons=odoo.addons +sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER +default_section=THIRDPARTY +ensure_newline_before_comments = True diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cb8b5ef27a4408c9767c962d0f4e70fb99715061 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,123 @@ +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/| + # Library files can have extraneous formatting (even minimized) + /static/(src/)?lib/| + # Repos using Sphinx to generate docs don't need prettying + ^docs/_templates/.*\.html$| + # 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$" + - repo: https://github.com/oca/maintainer-tools + rev: ab1d7f6 + hooks: + # update the NOT INSTALLABLE ADDONS section above + - id: oca-update-pre-commit-excluded-addons + - repo: https://github.com/myint/autoflake + rev: v1.4 + hooks: + - id: autoflake + 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: 20.8b1 + hooks: + - id: black + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.1.2 + hooks: + - id: prettier + 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: 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: mixed-line-ending + args: ["--fix=lf"] + - repo: https://github.com/asottile/pyupgrade + rev: v2.7.2 + hooks: + - id: pyupgrade + args: ["--keep-percent-format"] + - repo: https://github.com/PyCQA/isort + rev: 5.5.1 + hooks: + - id: isort + name: isort except __init__.py + args: + - --settings=. + exclude: /__init__\.py$ + - repo: https://gitlab.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 + hooks: + - id: pylint + 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 + args: + - --rcfile=.pylintrc-mandatory + additional_dependencies: *pylint_deps diff --git a/.prettierrc.yml b/.prettierrc.yml new file mode 100644 index 0000000000000000000000000000000000000000..5b6d4b361ace92f3877993bf2848fac190d8fab6 --- /dev/null +++ b/.prettierrc.yml @@ -0,0 +1,8 @@ +# 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 new file mode 100644 index 0000000000000000000000000000000000000000..c3d0a5c839baeee21312961c56158de4936fdc91 --- /dev/null +++ b/.pylintrc @@ -0,0 +1,88 @@ +[MASTER] +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=14.0 + +[MESSAGES CONTROL] +disable=all + +# This .pylintrc contains optional AND mandatory checks and is meant to be +# loaded in an IDE to have it check everything, in the hope this will make +# optional checks more visible to contributors who otherwise never look at a +# green travis to see optional checks that failed. +# .pylintrc-mandatory containing only mandatory checks is used the pre-commit +# config as a blocking check. + +enable=anomalous-backslash-in-string, + api-one-deprecated, + api-one-multi-together, + assignment-from-none, + attribute-deprecated, + class-camelcase, + dangerous-default-value, + dangerous-view-replace-wo-priority, + development-status-allowed, + duplicate-id-csv, + duplicate-key, + duplicate-xml-fields, + duplicate-xml-record-id, + eval-referenced, + eval-used, + incoherent-interpreter-exec-perm, + license-allowed, + manifest-author-string, + manifest-deprecated-key, + manifest-required-author, + manifest-required-key, + manifest-version-format, + method-compute, + method-inverse, + method-required-super, + method-search, + openerp-exception-warning, + pointless-statement, + pointless-string-statement, + print-used, + redundant-keyword-arg, + redundant-modulename-xml, + reimported, + relative-import, + return-in-init, + rst-syntax-error, + sql-injection, + too-few-format-args, + translation-field, + translation-required, + unreachable, + use-vim-comment, + wrong-tabs-instead-of-spaces, + xml-syntax-error, + # messages that do not cause the lint step to fail + consider-merging-classes-inherited, + create-user-wo-reset-password, + dangerous-filter-wo-user, + deprecated-module, + file-not-used, + invalid-commit, + missing-manifest-dependency, + missing-newline-extrafiles, + # missing-readme, + no-utf8-coding-comment, + odoo-addons-relative-import, + old-api7-method-defined, + redefined-builtin, + too-complex, + unnecessary-utf8-coding-comment + + +[REPORTS] +msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} +output-format=colorized +reports=no diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory new file mode 100644 index 0000000000000000000000000000000000000000..43ea23947166ff8080219007cfae43ec54a28f8e --- /dev/null +++ b/.pylintrc-mandatory @@ -0,0 +1,64 @@ +[MASTER] +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=14.0 + +[MESSAGES CONTROL] +disable=all + +enable=anomalous-backslash-in-string, + api-one-deprecated, + api-one-multi-together, + assignment-from-none, + attribute-deprecated, + class-camelcase, + dangerous-default-value, + dangerous-view-replace-wo-priority, + development-status-allowed, + duplicate-id-csv, + duplicate-key, + duplicate-xml-fields, + duplicate-xml-record-id, + eval-referenced, + eval-used, + incoherent-interpreter-exec-perm, + license-allowed, + manifest-author-string, + manifest-deprecated-key, + manifest-required-author, + manifest-required-key, + manifest-version-format, + method-compute, + method-inverse, + method-required-super, + method-search, + openerp-exception-warning, + pointless-statement, + pointless-string-statement, + print-used, + redundant-keyword-arg, + redundant-modulename-xml, + reimported, + relative-import, + return-in-init, + rst-syntax-error, + sql-injection, + too-few-format-args, + translation-field, + translation-required, + unreachable, + use-vim-comment, + wrong-tabs-instead-of-spaces, + xml-syntax-error + +[REPORTS] +msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} +output-format=colorized +reports=no diff --git a/__manifest__.py b/__manifest__.py index 26f0a154d8ebf475e1687dbfb8fa4334b49533e5..07b1170c5554cb0be30c0a3cd34cab888f8917e2 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -1,14 +1,12 @@ { - 'name': "ETIC - Contacts", - 'summary': "Etic - Contacts", - 'author': "Le Filament", - 'website': "https://www.le-filament.com", - 'version': '14.0.1.0.1', - 'license': "AGPL-3", - 'depends': [ - 'contacts' - ], - 'data': [ + "name": "ETIC - Contacts", + "summary": "Etic - Contacts", + "author": "Le Filament", + "website": "https://www.le-filament.com", + "version": "14.0.1.0.1", + "license": "AGPL-3", + "depends": ["contacts"], + "data": [ "security/ir.model.access.csv", # datas "datas/res_partner_commerce_status_data.xml", @@ -25,9 +23,9 @@ # views menu # wizard ], - 'qweb': [ + "qweb": [ # "static/src/xml/*.xml", ], - 'installable': True, - 'auto_install': False, + "installable": True, + "auto_install": False, } diff --git a/datas/res_partner_commerce_status_data.xml b/datas/res_partner_commerce_status_data.xml old mode 100755 new mode 100644 index e4cc33753dbdb10f2144ea686bc2970e7efb9eea..3322e4bc1566e08e39117768844f002d1216fd83 --- a/datas/res_partner_commerce_status_data.xml +++ b/datas/res_partner_commerce_status_data.xml @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <odoo> <data noupdate="1"> diff --git a/datas/res_partner_commerce_type_data.xml b/datas/res_partner_commerce_type_data.xml old mode 100755 new mode 100644 index 68c01251aed38fad2ed8f5d18aca3ca082c764ec..eb5cd95f3149943e3f6eb4be02a6268a4fa896a2 --- a/datas/res_partner_commerce_type_data.xml +++ b/datas/res_partner_commerce_type_data.xml @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <odoo> <data noupdate="1"> diff --git a/datas/res_partner_essaimage_status_data.xml b/datas/res_partner_essaimage_status_data.xml old mode 100755 new mode 100644 index b8bd290d99c6b3b41eb7b65d604db2b4a563725c..13fd8947371b2e69f8bf288d60b5ef0bd0115ea3 --- a/datas/res_partner_essaimage_status_data.xml +++ b/datas/res_partner_essaimage_status_data.xml @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <odoo> <data noupdate="1"> @@ -18,7 +18,7 @@ <field name="name">Sélectionné</field> </record> - <record id="status_out" model="res.partner.essaimage.status"> + <record id="status_essaimage_out" model="res.partner.essaimage.status"> <field name="name">Sorti</field> </record> diff --git a/datas/res_partner_legal_status_data.xml b/datas/res_partner_legal_status_data.xml old mode 100755 new mode 100644 index 4a1539033a2ec9712a37ddc08de742a05ecfd849..ea43f9de63f4520247e2c05b5d85d6fcfa2fabd9 --- a/datas/res_partner_legal_status_data.xml +++ b/datas/res_partner_legal_status_data.xml @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <odoo> <data noupdate="1"> diff --git a/datas/res_partner_participation.xml b/datas/res_partner_participation.xml old mode 100755 new mode 100644 index 43d972527f7ebdc1c02f8c14e2db6f62490b1e6b..e5cc4215c69ed32382c01c69d4019e6268e62db3 --- a/datas/res_partner_participation.xml +++ b/datas/res_partner_participation.xml @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <odoo> <data noupdate="1"> diff --git a/datas/res_partner_prescripteur.xml b/datas/res_partner_prescripteur.xml old mode 100755 new mode 100644 index f6339ac6515e088cba9e6fdd085802b361e6a70a..0a7004f953ad94e49288fe35e5d5a25760e5789b --- a/datas/res_partner_prescripteur.xml +++ b/datas/res_partner_prescripteur.xml @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <odoo> <data noupdate="1"> diff --git a/datas/res_partner_subtype_data.xml b/datas/res_partner_subtype_data.xml old mode 100755 new mode 100644 index 415dbf0f7200432cf1ea465568b51593f19a82d5..880a61a52ba49e5a36bdf8c7650b1abffcbb1361 --- a/datas/res_partner_subtype_data.xml +++ b/datas/res_partner_subtype_data.xml @@ -1,60 +1,60 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <odoo> <data noupdate="1"> <record id="subtype_collect_point" model="res.partner.subtype"> <field name="name">Point de collecte</field> - <field name="parent_type_id" ref="etic_partner.type_shop"/> + <field name="parent_type_id" ref="etic_partner.type_shop" /> </record> <record id="subtype_user" model="res.partner.subtype"> <field name="name">Utilisateur de boîtes</field> - <field name="parent_type_id" ref="etic_partner.type_shop"/> + <field name="parent_type_id" ref="etic_partner.type_shop" /> </record> <record id="subtype_community" model="res.partner.subtype"> <field name="name">Collectivité</field> - <field name="parent_type_id" ref="etic_partner.type_partnership"/> + <field name="parent_type_id" ref="etic_partner.type_partnership" /> </record> <record id="subtype_company" model="res.partner.subtype"> <field name="name">Entreprise</field> - <field name="parent_type_id" ref="etic_partner.type_partnership"/> + <field name="parent_type_id" ref="etic_partner.type_partnership" /> </record> <record id="subtype_foundation" model="res.partner.subtype"> <field name="name">Fondation d'entreprise</field> - <field name="parent_type_id" ref="etic_partner.type_partnership"/> + <field name="parent_type_id" ref="etic_partner.type_partnership" /> </record> <record id="subtype_club" model="res.partner.subtype"> <field name="name">Club d'entreprise</field> - <field name="parent_type_id" ref="etic_partner.type_partnership"/> + <field name="parent_type_id" ref="etic_partner.type_partnership" /> </record> <record id="subtype_waste_union" model="res.partner.subtype"> <field name="name">Syndicat de déchets</field> - <field name="parent_type_id" ref="etic_partner.type_partnership"/> + <field name="parent_type_id" ref="etic_partner.type_partnership" /> </record> <record id="subtype_banq" model="res.partner.subtype"> <field name="name">Banque</field> - <field name="parent_type_id" ref="etic_partner.type_partnership"/> + <field name="parent_type_id" ref="etic_partner.type_partnership" /> </record> <record id="subtype_funder" model="res.partner.subtype"> <field name="name">Financeur solidaire</field> - <field name="parent_type_id" ref="etic_partner.type_partnership"/> + <field name="parent_type_id" ref="etic_partner.type_partnership" /> </record> <record id="subtype_local_supplier" model="res.partner.subtype"> <field name="name">Local</field> - <field name="parent_type_id" ref="etic_partner.type_supplier"/> + <field name="parent_type_id" ref="etic_partner.type_supplier" /> </record> <record id="subtype_other_supplier" model="res.partner.subtype"> <field name="name">Autre fournisseur</field> - <field name="parent_type_id" ref="etic_partner.type_supplier"/> + <field name="parent_type_id" ref="etic_partner.type_supplier" /> </record> </data> diff --git a/datas/res_partner_type_data.xml b/datas/res_partner_type_data.xml old mode 100755 new mode 100644 index 29f9aa83591f11b203d09bcb25d1b4b930f46fda..0a5f5b0141d803e5ad6455a1a5f8f3f2ae357d71 --- a/datas/res_partner_type_data.xml +++ b/datas/res_partner_type_data.xml @@ -1,4 +1,4 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <odoo> <data noupdate="1"> diff --git a/models/res_partner.py b/models/res_partner.py index 4d47c62e4a7aab626d29ccc298a18bbe0b6cd50d..0f7d34c717ae1f8121615d32dee2b93424682225 100644 --- a/models/res_partner.py +++ b/models/res_partner.py @@ -1,7 +1,7 @@ # Copyright 2021 Le Filament (<http://www.le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import fields, models, api +from odoo import api, fields, models class EticPartner(models.Model): @@ -13,152 +13,130 @@ class EticPartner(models.Model): # Général type_id = fields.Many2one( - comodel_name='res.partner.type', - string='Type de contact', - required=False) + comodel_name="res.partner.type", string="Type de contact", required=False + ) subtype_id = fields.Many2one( - comodel_name='res.partner.subtype', - string='Sous-type de contact', - required=False) + comodel_name="res.partner.subtype", + string="Sous-type de contact", + required=False, + ) - service = fields.Char( - string='Service', - required=False) + service = fields.Char(string="Service", required=False) - facebook = fields.Char( - string='Facebook', - required=False) - twitter = fields.Char( - string='Twitter', - required=False) - instagram = fields.Char( - string='Instagram', - required=False) + facebook = fields.Char(string="Facebook", required=False) + twitter = fields.Char(string="Twitter", required=False) + instagram = fields.Char(string="Instagram", required=False) # Commerce +<<<<<<< HEAD business_name = fields.Char( string='Raison sociale', required=False) +======= + business_name = fields.Char(string="Nom commercial", required=False) +>>>>>>> [enh] pre-commit commerce_type_id = fields.Many2one( - comodel_name='res.partner.commerce.type', - string='Type de commerce', - required=False) + comodel_name="res.partner.commerce.type", + string="Type de commerce", + required=False, + ) legal_status_id = fields.Many2one( - comodel_name='res.partner.legal.status', - string='Forme juridique', - required=False) + comodel_name="res.partner.legal.status", + string="Forme juridique", + required=False, + ) commerce_status_id = fields.Many2one( - comodel_name='res.partner.commerce.status', - string='Statut du commerce', + comodel_name="res.partner.commerce.status", + string="Statut du commerce", required=False, - tracking=True) + tracking=True, + ) gt_commerce_participation = fields.Boolean( - string='Participe au GT Commerce', - required=False) - meg = fields.Char( - string='Numéro MEG', - required=False) + string="Participe au GT Commerce", required=False + ) + meg = fields.Char(string="Numéro MEG", required=False) prescripteur_id = fields.Many2one( - comodel_name='res.partner.prescripteur', - string='Prescripteur', - required=False) - network_starting_date = fields.Date( - string='Date entrée réseau', - required=False) + comodel_name="res.partner.prescripteur", string="Prescripteur", required=False + ) + network_starting_date = fields.Date(string="Date entrée réseau", required=False) participation_ids = fields.Many2many( - comodel_name='res.partner.participation', - string='Participe à') + comodel_name="res.partner.participation", string="Participe à" + ) # Adhésion à ETIC - is_partner_member = fields.Boolean( - string='Adhérent', - required=False, - tracking=True) - partner_membership_date = fields.Date( - string='Date d\'adhésion', - required=False) + is_partner_member = fields.Boolean(string="Adhérent", required=False, tracking=True) + partner_membership_date = fields.Date(string="Date d'adhésion", required=False) is_partnesrship_committee = fields.Boolean( - string='Participe au comité partenarial', - required=False) + string="Participe au comité partenarial", required=False + ) is_cofunder_college = fields.Boolean( - string='Est au collège cofondateur', - required=False) + string="Est au collège cofondateur", required=False + ) is_resident_college = fields.Boolean( - string='Est au collège habitant', - required=False) - is_active_volunteer = fields.Boolean( - string='Est bénévole actif', - required=False) - is_employee = fields.Boolean( - string='Est salarié', - required=False) + string="Est au collège habitant", required=False + ) + is_active_volunteer = fields.Boolean(string="Est bénévole actif", required=False) + is_employee = fields.Boolean(string="Est salarié", required=False) # Adhésion à la structure - is_etic_member = fields.Boolean( - string='Nous sommes adhérents', - required=False) - etic_membership_date = fields.Date( - string='Date de notre adhésion', - required=False) + is_etic_member = fields.Boolean(string="Nous sommes adhérents", required=False) + etic_membership_date = fields.Date(string="Date de notre adhésion", required=False) # Consignes deposit_balance = fields.Float( - string='Solde consignes', + string="Solde consignes", # currency_field='company_id.currency_id', - required=False) + required=False, + ) deposit_balance_date = fields.Date( - string='Date relevé solde consignes', - required=False) + string="Date relevé solde consignes", required=False + ) # Horaires delivery_schedule_ids = fields.One2many( - comodel_name='res.partner.delivery.schedule', - inverse_name='partner_id', - string='Créneaux de livraisons') + comodel_name="res.partner.delivery.schedule", + inverse_name="partner_id", + string="Créneaux de livraisons", + ) spot_schedule_ids = fields.One2many( - comodel_name='res.partner.spot.schedule', - inverse_name='partner_id', - string='Emplacements (commerces itinérants)') - time_slot = fields.Text( - string='Créneaux attribués', - required=False) + comodel_name="res.partner.spot.schedule", + inverse_name="partner_id", + string="Emplacements (commerces itinérants)", + ) + time_slot = fields.Text(string="Créneaux attribués", required=False) opening_schedule_ids = fields.One2many( - comodel_name='res.partner.opening.schedule', - inverse_name='partner_id', - string='Horaires d\'ouverture') - order_conditions = fields.Text( - string='Modalités de la commande', - required=False) + comodel_name="res.partner.opening.schedule", + inverse_name="partner_id", + string="Horaires d'ouverture", + ) + order_conditions = fields.Text(string="Modalités de la commande", required=False) # Essaimage convention_date1 = fields.Date( - string='Date signature convention Phase 1', - required=False) + string="Date signature convention Phase 1", required=False + ) convention_date2 = fields.Date( - string='Date signature convention Phase 2', - required=False) - exchange_summary = fields.Text( - string='Résumé des échanges', - required=False) + string="Date signature convention Phase 2", required=False + ) + exchange_summary = fields.Text(string="Résumé des échanges", required=False) webinar_participation_date = fields.Date( - string='Date Participation Webinaire', - required=False) - selection_date = fields.Date( - string='Date de sélection', - required=False) + string="Date Participation Webinaire", required=False + ) + selection_date = fields.Date(string="Date de sélection", required=False) essaimage_status_id = fields.Many2one( - comodel_name='res.partner.essaimage.status', - string='Avancement essaimage', - tracking=True) + comodel_name="res.partner.essaimage.status", + string="Avancement essaimage", + tracking=True, + ) # ------------------------------------------------------ # Onchange / Constraints # ------------------------------------------------------ - @api.onchange('company_type') + @api.onchange("company_type") def onchange_company_type(self): self.type_id = None - @api.onchange('type_id') + @api.onchange("type_id") def onchange_type(self): self.subtype_id = None @@ -166,8 +144,14 @@ class EticPartner(models.Model): # Override ORM # ------------------------------------------------------ @api.model - def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None): + def _name_search( + self, name, args=None, operator="ilike", limit=100, name_get_uid=None + ): if args is None: args = [] - domain = args + ['|', ('business_name', operator, name), ('name', operator, name)] + domain = args + [ + "|", + ("business_name", operator, name), + ("name", operator, name), + ] return self._search(domain, limit=limit, access_rights_uid=name_get_uid) diff --git a/models/res_partner_schedules_models.py b/models/res_partner_schedules_models.py index 1a31bb36deb4fe0cc1437e7ea5022472ed0ed96a..b47957a6f8047939db04f23656d19c30757628c3 100644 --- a/models/res_partner_schedules_models.py +++ b/models/res_partner_schedules_models.py @@ -2,6 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import fields, models + from ..tools import week_days @@ -10,19 +11,13 @@ class PartnerDeliverySchedule(models.Model): _description = "Créneaux des livraisons" partner_id = fields.Many2one( - comodel_name='res.partner', - string='Contact', - required=True) + comodel_name="res.partner", string="Contact", required=True + ) day = fields.Selection( - string='Jour', - selection=week_days.get_week_days(), - required=True) - opening_hour = fields.Float( - string='Début', - required=False) - closing_hour = fields.Float( - string='Fin', - required=False) + string="Jour", selection=week_days.get_week_days(), required=True + ) + opening_hour = fields.Float(string="Début", required=False) + closing_hour = fields.Float(string="Fin", required=False) class PartnerSpotSchedule(models.Model): @@ -30,16 +25,12 @@ class PartnerSpotSchedule(models.Model): _description = "Emplacements des commerces itinérants" partner_id = fields.Many2one( - comodel_name='res.partner', - string='Contact', - required=True) + comodel_name="res.partner", string="Contact", required=True + ) day = fields.Selection( - string='Jour', - selection=week_days.get_week_days(), - required=True) - spot = fields.Char( - string='Emplacement', - required=False) + string="Jour", selection=week_days.get_week_days(), required=True + ) + spot = fields.Char(string="Emplacement", required=False) class PartnerOpeningSchedule(models.Model): @@ -47,16 +38,10 @@ class PartnerOpeningSchedule(models.Model): _description = "Horaires et jours d'ouverture" partner_id = fields.Many2one( - comodel_name='res.partner', - string='Contact', - required=True) + comodel_name="res.partner", string="Contact", required=True + ) day = fields.Selection( - string='Jour', - selection=week_days.get_week_days(), - required=True) - opening_hour = fields.Float( - string='Début', - required=False) - closing_hour = fields.Float( - string='Fin', - required=False) + string="Jour", selection=week_days.get_week_days(), required=True + ) + opening_hour = fields.Float(string="Début", required=False) + closing_hour = fields.Float(string="Fin", required=False) diff --git a/models/res_partner_status_models.py b/models/res_partner_status_models.py index 385e1e126de7b966625b95c68cbbbe03a5ff49b1..c5c22d603062d41a107936d91332e9a39764e38e 100644 --- a/models/res_partner_status_models.py +++ b/models/res_partner_status_models.py @@ -8,11 +8,11 @@ class PartnerCommerceStatus(models.Model): _name = "res.partner.commerce.status" _description = "Statut du commerce" - name = fields.Char('Statut', required=True) + name = fields.Char("Statut", required=True) class PartnerEssaimageStatus(models.Model): _name = "res.partner.essaimage.status" _description = "Avancement essaimage" - name = fields.Char('Statut', required=True) + name = fields.Char("Statut", required=True) diff --git a/models/res_partner_types_models.py b/models/res_partner_types_models.py index 4d067235395fd2dd20ee3c2863ed50dee129b9a8..5a4798346981bfeb77511839a21934dedd40cdf3 100644 --- a/models/res_partner_types_models.py +++ b/models/res_partner_types_models.py @@ -8,54 +8,57 @@ class PartnerType(models.Model): _name = "res.partner.type" _description = "Type de contact" - name = fields.Char('Type', required=True) + name = fields.Char("Type", required=True) partner_type = fields.Selection( - string='Type de contact', - selection=[('person', 'Particulier'), - ('company', 'Société'), - ('all', 'Tous'), ], - required=True, ) + string="Type de contact", + selection=[ + ("person", "Particulier"), + ("company", "Société"), + ("all", "Tous"), + ], + required=True, + ) subtype_ids = fields.One2many( - comodel_name='res.partner.subtype', - inverse_name='parent_type_id', - string='Sous-type', - required=False) + comodel_name="res.partner.subtype", + inverse_name="parent_type_id", + string="Sous-type", + required=False, + ) class PartnerSubtype(models.Model): _name = "res.partner.subtype" _description = "Sous-Type de contact" - name = fields.Char('Sous-type', required=True) + name = fields.Char("Sous-type", required=True) parent_type_id = fields.Many2one( - comodel_name='res.partner.type', - string='Type du parent', - required=True) + comodel_name="res.partner.type", string="Type du parent", required=True + ) class PartnerCommerceType(models.Model): _name = "res.partner.commerce.type" _description = "Type de commerce" - name = fields.Char('Type de commerce', required=True) + name = fields.Char("Type de commerce", required=True) class PartnerLegalStatus(models.Model): _name = "res.partner.legal.status" _description = "Forme jurdique du contact" - name = fields.Char('Forme juridique', required=True) + name = fields.Char("Forme juridique", required=True) class PartnerPrescriteur(models.Model): _name = "res.partner.prescripteur" _description = "Prescripteur ETIC" - name = fields.Char('Type', required=True) + name = fields.Char("Type", required=True) class PartnerParticipation(models.Model): _name = "res.partner.participation" _description = "Activités / Événements" - name = fields.Char('Activité', required=True) \ No newline at end of file + name = fields.Char("Activité", required=True) diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv index 33dd0911c2131666b30f262cc9aca58c45ba9b09..7d8366cb90b0dd9cebbea9b40dd00c6dd3febc53 100644 --- a/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -20,4 +20,4 @@ admin_res_partner_opening_schedule,admin_res_partner_opening_schedule,model_res_ access_res_partner_commerce_status,access_res_partner_commerce_status,model_res_partner_commerce_status,base.group_user,1,0,0,0 admin_res_partner_commerce_status,admin_res_partner_commerce_status,model_res_partner_commerce_status,base.group_erp_manager,1,1,1,1 access_res_partner_essaimage_status,access_res_partner_essaimage_status,model_res_partner_essaimage_status,base.group_user,1,0,0,0 -admin_res_partner_essaimage_status,admin_res_partner_essaimage_status,model_res_partner_essaimage_status,base.group_erp_manager,1,1,1,1 \ No newline at end of file +admin_res_partner_essaimage_status,admin_res_partner_essaimage_status,model_res_partner_essaimage_status,base.group_erp_manager,1,1,1,1 diff --git a/tools/week_days.py b/tools/week_days.py index 94a98ed501952a9483f359aea882a7ef52754c04..1aba89fe4a13c74bc3f3ba87b66041442b705786 100644 --- a/tools/week_days.py +++ b/tools/week_days.py @@ -2,13 +2,14 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). WEEK_DAYS = [ - ('0', 'Lundi'), - ('1', 'Mardi'), - ('2', 'Mercredi'), - ('3', 'Jeudi'), - ('4', 'Vendredi'), - ('5', 'Samedi'), - ('6', 'Dimanche')] + ("0", "Lundi"), + ("1", "Mardi"), + ("2", "Mercredi"), + ("3", "Jeudi"), + ("4", "Vendredi"), + ("5", "Samedi"), + ("6", "Dimanche"), +] def get_week_days(): diff --git a/views/res_partner.xml b/views/res_partner.xml index 0254bdd9d286fb782f31a3e474181ad2913fc9ab..15554ed68a79de2b5b96c1384a59ea99ea6046e3 100644 --- a/views/res_partner.xml +++ b/views/res_partner.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> <!-- Copyright 2021 Le Filament License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> @@ -8,17 +8,25 @@ <record id="res_partner_form_inherit" model="ir.ui.view"> <field name="name">res.partner.form</field> <field name="model">res.partner</field> - <field name="inherit_id" ref="base.view_partner_form"/> - <field name="priority" eval="8"/> + <field name="inherit_id" ref="base.view_partner_form" /> + <field name="priority" eval="8" /> <field name="arch" type="xml"> <!-- Header --> <xpath expr="//sheet" position="before"> <header> - <field name="commerce_status_id" widget="statusbar" clickable="1" - attrs="{'invisible': [('type_id', 'not in', (%(etic_partner.type_shop)d, %(etic_partner.type_supplier)d))]}"/> - <field name="essaimage_status_id" widget="statusbar" clickable="1" - attrs="{'invisible': [('type_id', 'not in', (%(etic_partner.type_essaimage)d))]}"/> + <field + name="commerce_status_id" + widget="statusbar" + clickable="1" + attrs="{'invisible': [('type_id', 'not in', (%(etic_partner.type_shop)d, %(etic_partner.type_supplier)d))]}" + /> + <field + name="essaimage_status_id" + widget="statusbar" + clickable="1" + attrs="{'invisible': [('type_id', 'not in', (%(etic_partner.type_essaimage)d))]}" + /> </header> </xpath> @@ -26,15 +34,27 @@ <xpath expr="//sheet/group[1]" position="before"> <group col="2"> <group> - <field name="business_name" attrs="{'invisible': [('company_type', '=', 'person')]}"/> - <field name="type_id" options="{'no_open': True, 'no_create': True}" - domain="[('partner_type', 'in', [company_type, 'all'])]"/> - <field name="subtype_id" options="{'no_open': True, 'no_create': True}" - domain="[('parent_type_id', '=', type_id)]" - attrs="{'invisible': [('company_type', '=', 'person')]}"/> + <field + name="business_name" + attrs="{'invisible': [('company_type', '=', 'person')]}" + /> + <field + name="type_id" + options="{'no_open': True, 'no_create': True}" + domain="[('partner_type', 'in', [company_type, 'all'])]" + /> + <field + name="subtype_id" + options="{'no_open': True, 'no_create': True}" + domain="[('parent_type_id', '=', type_id)]" + attrs="{'invisible': [('company_type', '=', 'person')]}" + /> </group> <group> - <field name="meg" attrs="{'invisible': [('company_type', '=', 'person')]}"/> + <field + name="meg" + attrs="{'invisible': [('company_type', '=', 'person')]}" + /> </group> </group> </xpath> @@ -42,77 +62,125 @@ <!-- Function and service for contact person --> <xpath expr="//field[@name='function']" position="attributes"> <attribute name="string">Fonction</attribute> - <attribute name="attrs">{'invisible': [('company_type', '!=', 'person')]}</attribute> + <attribute + name="attrs" + >{'invisible': [('company_type', '!=', 'person')]}</attribute> </xpath> <xpath expr="//field[@name='function']" position="after"> - <field name="service" attrs="{'invisible': [('company_type', '!=', 'person')]}"/> + <field + name="service" + attrs="{'invisible': [('company_type', '!=', 'person')]}" + /> </xpath> <!-- Change place of state_id in adress --> - <xpath expr="//div[hasclass('o_address_format')]/field[@name='state_id']" position="attributes"> - <attribute name="invisible" eval="1="/> + <xpath + expr="//div[hasclass('o_address_format')]/field[@name='state_id']" + position="attributes" + > + <attribute name="invisible" eval="1=" /> </xpath> - <xpath expr="//div[hasclass('o_address_format')]/field[@name='country_id']" position="after"> - <field name="state_id" class="o_address_state" placeholder="Région" options="{'no_open': True, 'no_quick_create': True}" - attrs="{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}" context="{'country_id': country_id, 'default_country_id': country_id, 'zip': zip}"/> + <xpath + expr="//div[hasclass('o_address_format')]/field[@name='country_id']" + position="after" + > + <field + name="state_id" + class="o_address_state" + placeholder="Région" + options="{'no_open': True, 'no_quick_create': True}" + attrs="{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}" + context="{'country_id': country_id, 'default_country_id': country_id, 'zip': zip}" + /> </xpath> <!-- Social Websites --> <xpath expr="//field[@name='website']" position="after"> - <field name="facebook" widget="url"/> - <field name="twitter" widget="url"/> - <field name="instagram" widget="url"/> + <field name="facebook" widget="url" /> + <field name="twitter" widget="url" /> + <field name="instagram" widget="url" /> </xpath> <!-- Membership --> <xpath expr="//sheet/group[2]" position="inside"> - <group attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_other)d))]}"> - <field name="is_etic_member" widget="boolean_toggle"/> - <field name="etic_membership_date" attrs="{'invisible': [('is_etic_member', '!=', True)]}"/> + <group + attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_other)d))]}" + > + <field name="is_etic_member" widget="boolean_toggle" /> + <field + name="etic_membership_date" + attrs="{'invisible': [('is_etic_member', '!=', True)]}" + /> </group> </xpath> <!-- Contact address --> - <xpath expr="//page[@name='contact_addresses']//form//field[@name='function']" position="attributes"> + <xpath + expr="//page[@name='contact_addresses']//form//field[@name='function']" + position="attributes" + > <attribute name="string">Fonction</attribute> </xpath> - <xpath expr="//page[@name='contact_addresses']//form//field[@name='function']" position="after"> - <field name="service" attrs="{'invisible': [('type','!=', 'contact')]}"/> + <xpath + expr="//page[@name='contact_addresses']//form//field[@name='function']" + position="after" + > + <field + name="service" + attrs="{'invisible': [('type','!=', 'contact')]}" + /> </xpath> <!-- New pages --> <xpath expr="//page[@name='sales_purchases']" position="after"> - <page name='commerce' string="Commerce" - attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_shop)d))]}"> + <page + name='commerce' + string="Commerce" + attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_shop)d))]}" + > <group col="2"> <group> - <field name="commerce_type_id" options="{'no_open': True, 'no_create': True}"/> - <field name="legal_status_id" options="{'no_open': True, 'no_create': True}"/> - <field name="prescripteur_id" options="{'no_open': True, 'no_create': True}"/> - <field name="gt_commerce_participation" widget="boolean_toggle"/> + <field + name="commerce_type_id" + options="{'no_open': True, 'no_create': True}" + /> + <field + name="legal_status_id" + options="{'no_open': True, 'no_create': True}" + /> + <field + name="prescripteur_id" + options="{'no_open': True, 'no_create': True}" + /> + <field + name="gt_commerce_participation" + widget="boolean_toggle" + /> </group> <group> - <field name="network_starting_date"/> - <field name="participation_ids" - options="{'no_open': True, 'no_create': True}" - widget="many2many_tags"/> - <field name="deposit_balance" widget="monetary"/> - <field name="deposit_balance_date"/> + <field name="network_starting_date" /> + <field + name="participation_ids" + options="{'no_open': True, 'no_create': True}" + widget="many2many_tags" + /> + <field name="deposit_balance" widget="monetary" /> + <field name="deposit_balance_date" /> </group> </group> <group> <field name="delivery_schedule_ids"> <tree editable="top"> - <field name="day"/> - <field name="opening_hour" widget="float_time"/> - <field name="closing_hour" widget="float_time"/> + <field name="day" /> + <field name="opening_hour" widget="float_time" /> + <field name="closing_hour" widget="float_time" /> </tree> </field> <field name="spot_schedule_ids"> <tree editable="top"> - <field name="day"/> - <field name="spot"/> + <field name="day" /> + <field name="spot" /> </tree> </field> </group> @@ -121,47 +189,82 @@ <page name='association' string="Association"> <group col="2"> <group> - <field name="is_partner_member" widget="boolean_toggle"/> - <field name="partner_membership_date" attrs="{'invisible': [('is_partner_member', '!=', True)]}"/> + <field + name="is_partner_member" + widget="boolean_toggle" + /> + <field + name="partner_membership_date" + attrs="{'invisible': [('is_partner_member', '!=', True)]}" + /> </group> - <group attrs="{'invisible': [('is_partner_member', '!=', True)]}"> - <field name="is_partnesrship_committee" widget="boolean_toggle" - attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_partnership)d))]}"/> - <field name="is_cofunder_college" widget="boolean_toggle" - attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_individual)d))]}"/> - <field name="is_resident_college" widget="boolean_toggle" - attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_individual)d))]}"/> - <field name="is_active_volunteer" widget="boolean_toggle" - attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_individual)d))]}"/> - <field name="is_employee" widget="boolean_toggle" - attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_individual)d))]}"/> + <group + attrs="{'invisible': [('is_partner_member', '!=', True)]}" + > + <field + name="is_partnesrship_committee" + widget="boolean_toggle" + attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_partnership)d))]}" + /> + <field + name="is_cofunder_college" + widget="boolean_toggle" + attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_individual)d))]}" + /> + <field + name="is_resident_college" + widget="boolean_toggle" + attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_individual)d))]}" + /> + <field + name="is_active_volunteer" + widget="boolean_toggle" + attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_individual)d))]}" + /> + <field + name="is_employee" + widget="boolean_toggle" + attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_individual)d))]}" + /> </group> </group> </page> - <page name='essaimage' string="Essaimage" - attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_essaimage)d))]}"> + <page + name='essaimage' + string="Essaimage" + attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_essaimage)d))]}" + > <group> - <field name="convention_date1"/> - <field name="convention_date2"/> - <field name="exchange_summary"/> - <field name="webinar_participation_date"/> - <field name="selection_date"/> + <field name="convention_date1" /> + <field name="convention_date2" /> + <field name="exchange_summary" /> + <field name="webinar_participation_date" /> + <field name="selection_date" /> </group> </page> - <page name='schedule' string="Horaires" - attrs="{'invisible': [('company_type', '=', 'person')]}"> + <page + name='schedule' + string="Horaires" + attrs="{'invisible': [('company_type', '=', 'person')]}" + > <group> - <field name="time_slot" attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_supplier)d))]}"/> + <field + name="time_slot" + attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_supplier)d))]}" + /> <field name="opening_schedule_ids"> <tree editable="top"> - <field name="day"/> - <field name="opening_hour" widget="float_time"/> - <field name="closing_hour" widget="float_time"/> + <field name="day" /> + <field name="opening_hour" widget="float_time" /> + <field name="closing_hour" widget="float_time" /> </tree> </field> - <field name="order_conditions" attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_supplier)d))]}"/> + <field + name="order_conditions" + attrs="{'invisible': [('type_id', '!=', (%(etic_partner.type_supplier)d))]}" + /> </group> </page> @@ -171,55 +274,65 @@ </record> <!-- TREE VIEW --> - <record id="res_partner_tree_view_inherit" model="ir.ui.view" > + <record id="res_partner_tree_view_inherit" model="ir.ui.view"> <field name="name">res.partner.tree</field> <field name="model">res.partner</field> - <field name="inherit_id" ref="base.view_partner_tree"/> + <field name="inherit_id" ref="base.view_partner_tree" /> <field name="arch" type="xml"> <xpath expr="//field[@name='display_name']" position="after"> - <field name="business_name"/> + <field name="business_name" /> </xpath> </field> </record> <!-- KANBAN VIEW --> - <record id="res_partner_kanban_view_inherit" model="ir.ui.view" > + <record id="res_partner_kanban_view_inherit" model="ir.ui.view"> <field name="name">res.partner.kanban</field> <field name="model">res.partner</field> - <field name="inherit_id" ref="base.res_partner_kanban_view"/> + <field name="inherit_id" ref="base.res_partner_kanban_view" /> <field name="arch" type="xml"> <xpath expr="//field[@name='display_name'][1]" position="after"> - <field name="business_name"/> + <field name="business_name" /> </xpath> - <xpath expr="//div[hasclass('o_kanban_tags_section')]" position="before"> - <strong class="o_kanban_record_title oe_partner_heading"><field name="business_name"/></strong> + <xpath + expr="//div[hasclass('o_kanban_tags_section')]" + position="before" + > + <strong class="o_kanban_record_title oe_partner_heading"><field + name="business_name" + /></strong> </xpath> </field> </record> <!-- SEARCH VIEW --> - <record id="res_partner_search_view_inherit" model="ir.ui.view" > + <record id="res_partner_search_view_inherit" model="ir.ui.view"> <field name="name">res.partner.search</field> <field name="model">res.partner</field> - <field name="inherit_id" ref="base.view_res_partner_filter"/> + <field name="inherit_id" ref="base.view_res_partner_filter" /> <field name="arch" type="xml"> <xpath expr="//search/field[@name='name']" position="attributes"> - <attribute name="filter_domain">['|', '|', '|', ('business_name', 'ilike', self), ('display_name', 'ilike', self), ('ref', '=', self), ('email', 'ilike', self)]</attribute> + <attribute + name="filter_domain" + >['|', '|', '|', ('business_name', 'ilike', self), ('display_name', 'ilike', self), ('ref', '=', self), ('email', 'ilike', self)]</attribute> </xpath> </field> </record> <!-- FORM SIMPLIFIED VIEW --> - <record id="res_partner_simplified_form_view_inherit" model="ir.ui.view" > + <record id="res_partner_simplified_form_view_inherit" model="ir.ui.view"> <field name="name">res.partner.simplified.form</field> <field name="model">res.partner</field> - <field name="inherit_id" ref="base.view_partner_simple_form"/> + <field name="inherit_id" ref="base.view_partner_simple_form" /> <field name="arch" type="xml"> <xpath expr="//group/field[@name='function']" position="attributes"> <attribute name="string">Fonction</attribute> </xpath> <xpath expr="//group/field[@name='function']" position="after"> - <field name="service" attrs="{'invisible': [('is_company','=', True)]}"/> + <field + name="service" + attrs="{'invisible': [('is_company','=', True)]}" + /> </xpath> </field> </record> diff --git a/views/res_partner_config.xml b/views/res_partner_config.xml index 7d097ef7973d825a997db3e64f62391d7e0eb2df..824a9fb62dba368d37fdeb1dad3ff3ab08adcd71 100644 --- a/views/res_partner_config.xml +++ b/views/res_partner_config.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> <!-- Copyright 2021 Le Filament License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> @@ -10,7 +10,7 @@ <field name="model">res.partner.participation</field> <field name="arch" type="xml"> <tree string="Activités / Événements" editable="top"> - <field name="name"/> + <field name="name" /> </tree> </field> </record> @@ -26,7 +26,7 @@ <field name="model">res.partner.prescripteur</field> <field name="arch" type="xml"> <tree string="Prescripteur" editable="top"> - <field name="name"/> + <field name="name" /> </tree> </field> </record> @@ -42,7 +42,7 @@ <field name="model">res.partner.legal.status</field> <field name="arch" type="xml"> <tree string="Forme juridique" editable="top"> - <field name="name"/> + <field name="name" /> </tree> </field> </record> @@ -58,7 +58,7 @@ <field name="model">res.partner.commerce.type</field> <field name="arch" type="xml"> <tree string="Type de commerce" editable="top"> - <field name="name"/> + <field name="name" /> </tree> </field> </record> @@ -74,7 +74,7 @@ <field name="model">res.partner.subtype</field> <field name="arch" type="xml"> <tree string="Type contact" editable="top"> - <field name="name"/> + <field name="name" /> </tree> </field> </record> @@ -90,8 +90,8 @@ <field name="model">res.partner.type</field> <field name="arch" type="xml"> <tree string="Type contact" editable="top" create="0"> - <field name="name"/> - <field name="partner_type"/> + <field name="name" /> + <field name="partner_type" /> </tree> </field> </record> @@ -107,7 +107,7 @@ <field name="model">res.partner.commerce.status</field> <field name="arch" type="xml"> <tree string="Statuts des commerces" editable="top"> - <field name="name"/> + <field name="name" /> </tree> </field> </record> @@ -123,7 +123,7 @@ <field name="model">res.partner.essaimage.status</field> <field name="arch" type="xml"> <tree string="Statuts des essaimages" editable="top"> - <field name="name"/> + <field name="name" /> </tree> </field> </record> @@ -135,51 +135,77 @@ <!-- MENUS --> + <menuitem id="contacts.res_partner_menu_config" + name="Configuration" + parent="contacts.menu_contacts" + groups="base.group_erp_manager" + sequence="99"/> + <!-- Typologie --> - <menuitem id="menu_res_partner_typologie" - parent="contacts.res_partner_menu_config" - name="Typologie" - sequence="10"/> + <menuitem + id="menu_res_partner_typologie" + parent="contacts.res_partner_menu_config" + name="Typologie" + sequence="10" + /> - <menuitem id="menu_res_partner_type" - parent="menu_res_partner_typologie" - action="action_res_partner_type" - sequence="10"/> - <menuitem id="menu_res_partner_subtype" - parent="menu_res_partner_typologie" - action="action_res_partner_subtype" - sequence="20"/> - <menuitem id="menu_res_partner_commerce_type" - parent="menu_res_partner_typologie" - action="action_res_partner_commerce_type" - sequence="30"/> - <menuitem id="menu_res_partner_legal_status" - parent="menu_res_partner_typologie" - action="action_res_partner_legal_status" - sequence="40"/> - <menuitem id="menu_res_partner_prescripteur" - parent="menu_res_partner_typologie" - action="action_res_partner_prescripteur" - sequence="50"/> - <menuitem id="menu_res_partner_participation" - parent="menu_res_partner_typologie" - action="action_res_partner_participation" - sequence="60"/> + <menuitem + id="menu_res_partner_type" + parent="menu_res_partner_typologie" + action="action_res_partner_type" + sequence="10" + /> + <menuitem + id="menu_res_partner_subtype" + parent="menu_res_partner_typologie" + action="action_res_partner_subtype" + sequence="20" + /> + <menuitem + id="menu_res_partner_commerce_type" + parent="menu_res_partner_typologie" + action="action_res_partner_commerce_type" + sequence="30" + /> + <menuitem + id="menu_res_partner_legal_status" + parent="menu_res_partner_typologie" + action="action_res_partner_legal_status" + sequence="40" + /> + <menuitem + id="menu_res_partner_prescripteur" + parent="menu_res_partner_typologie" + action="action_res_partner_prescripteur" + sequence="50" + /> + <menuitem + id="menu_res_partner_participation" + parent="menu_res_partner_typologie" + action="action_res_partner_participation" + sequence="60" + /> <!-- Statuts --> - <menuitem id="menu_res_partner_status" - parent="contacts.res_partner_menu_config" - name="Statuts" - sequence="20"/> + <menuitem + id="menu_res_partner_status" + parent="contacts.res_partner_menu_config" + name="Statuts" + sequence="20" + /> - <menuitem id="menu_res_partner_commerce_status" - parent="menu_res_partner_status" - action="action_res_partner_commerce_status" - sequence="10"/> - <menuitem id="menu_res_partner_essaimage_status" - parent="menu_res_partner_status" - action="action_res_partner_essaimage_status" - sequence="20"/> + <menuitem + id="menu_res_partner_commerce_status" + parent="menu_res_partner_status" + action="action_res_partner_commerce_status" + sequence="10" + /> + <menuitem + id="menu_res_partner_essaimage_status" + parent="menu_res_partner_status" + action="action_res_partner_essaimage_status" + sequence="20" + /> </data> </odoo>