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..d4cc423ccda9db9691205c9da83307af97b2670f --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,187 @@ +env: + browser: true + es6: true + +# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449 +parserOptions: + ecmaVersion: 2017 + +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 + +# 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..1c6434bfc2274c73d98dbf62b6de9baccdc353ce --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,127 @@ +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/|^.copier-answers.yml$|^.github/| + # Maybe reactivate this when all README files include prettier ignore tags? + ^README\.md$| + # 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 + - id: oca-fix-manifest-website + args: ["https://le-filament.com"] + - 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..dc6270e15be0c08da00e768a570f27c785d8630e --- /dev/null +++ b/.pylintrc @@ -0,0 +1,87 @@ +[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, + 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/__init__.py b/__init__.py index f8a7089ea933a7ade21f775a637d381e6e53895c..a39f7c97a5af0eb47047e7bb0ff40b6127531aea 100644 --- a/__init__.py +++ b/__init__.py @@ -1,5 +1,4 @@ # © 2021 Le Filament (<http://www.le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from . import models -from . import wizard +from . import models, wizard diff --git a/__manifest__.py b/__manifest__.py index 622f642872b9883979288c26fff17a7721356f40..e6256944f6c6c2f2dad1eac48aea7c5237384e28 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -1,7 +1,7 @@ { "name": "CG SCOP - Processus d'adhésion", "summary": "CG SCOP - Processus d'adhésion", - "version": "12.1.0.0", + "version": "14.0.1.0.0", "development_status": "Production/Stable", "author": "Le Filament", "license": "AGPL-3", @@ -21,8 +21,6 @@ "views/assets.xml", "views/res_config_settings.xml", "views/res_partner.xml", - "views/res_partner_federation.xml", - "views/res_partner_naf.xml", "views/res_partner_project_invoicing_status.xml", "views/scop_adhesion_file.xml", # report @@ -30,5 +28,5 @@ # wizard "wizard/scop_adhesion_year_wizard.xml", "wizard/scop_compulsory_fields_suivi_wizard.xml", - ] + ], } diff --git a/datas/ir_sequence_data.xml b/datas/ir_sequence_data.xml index 73ddbb4f1fd2f632247e30ebfbde0955cddd5c6b..1eb9639c8c197898c8e3d000754d089ce20e6353 100644 --- a/datas/ir_sequence_data.xml +++ b/datas/ir_sequence_data.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> <odoo> <data noupdate="1"> @@ -7,7 +7,7 @@ <field name="code">scop.membership.period</field> <field name="padding">5</field> <field name="implementation">no_gap</field> - <field name="company_id" ref="base.main_company"/> + <field name="company_id" ref="base.main_company" /> <field name="number_increment">1</field> </record> diff --git a/datas/scop_adhesion_file_data.xml b/datas/scop_adhesion_file_data.xml index f90bfe73796547add055a7fc09016c7b3258065a..8879a5110bcae109361f17b3326f4aefb574603b 100644 --- a/datas/scop_adhesion_file_data.xml +++ b/datas/scop_adhesion_file_data.xml @@ -1,310 +1,310 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> <odoo> <data noupdate="1"> <!-- Coop 47--> <record id="coop_47_decla_adhesion" model="scop.adhesion.file"> <field name="name">Coop 47 - Déclaration d'adhésion</field> - <field name="coop_type_id" ref="cgscop_partner.form_coop47"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_coop47" /> + <field name="is_compulsory" eval="True" /> </record> <record id="coop_47_mandat" model="scop.adhesion.file"> <field name="name">Coop 47 - Mandat de prélèvement SEPA</field> - <field name="coop_type_id" ref="cgscop_partner.form_coop47"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_coop47" /> + <field name="is_compulsory" eval="True" /> </record> <record id="coop_47_rib" model="scop.adhesion.file"> <field name="name">Coop 47 - RIB (IBAN)</field> - <field name="coop_type_id" ref="cgscop_partner.form_coop47"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_coop47" /> + <field name="is_compulsory" eval="True" /> </record> <record id="coop_47_bordereau" model="scop.adhesion.file"> <field name="name">Coop 47 - Bordereau de calcul des cotisations</field> - <field name="coop_type_id" ref="cgscop_partner.form_coop47"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_coop47" /> + <field name="is_compulsory" eval="True" /> </record> <record id="coop_47_demande_inscri" model="scop.adhesion.file"> <field name="name">Coop 47 - Lettre de demande d'inscritption</field> - <field name="coop_type_id" ref="cgscop_partner.form_coop47"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_coop47" /> + <field name="is_compulsory" eval="True" /> </record> <record id="coop_47_fiche_renseignements" model="scop.adhesion.file"> <field name="name">Coop 47 - Fiche de renseignements</field> - <field name="coop_type_id" ref="cgscop_partner.form_coop47"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_coop47" /> + <field name="is_compulsory" eval="True" /> </record> <record id="coop_47_paiement" model="scop.adhesion.file"> <field name="name">Coop 47 - Chèque ou récépissé ordre de virement</field> - <field name="coop_type_id" ref="cgscop_partner.form_coop47"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_coop47" /> + <field name="is_compulsory" eval="True" /> </record> <record id="coop_47_statuts" model="scop.adhesion.file"> <field name="name">Coop 47 - Statuts (en 2 exemplaires)</field> - <field name="coop_type_id" ref="cgscop_partner.form_coop47"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_coop47" /> + <field name="is_compulsory" eval="True" /> </record> <record id="coop_47_pub" model="scop.adhesion.file"> <field name="name">Coop 47 - Annonce publicité légale</field> - <field name="coop_type_id" ref="cgscop_partner.form_coop47"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_coop47" /> + <field name="is_compulsory" eval="True" /> </record> <record id="coop_47_kbis" model="scop.adhesion.file"> <field name="name">Coop 47 - Extrait Kbis</field> - <field name="coop_type_id" ref="cgscop_partner.form_coop47"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_coop47" /> + <field name="is_compulsory" eval="True" /> </record> - + <!-- Lamaneur--> <record id="lamaneur_decla_adhesion" model="scop.adhesion.file"> <field name="name">Lamaneur - Déclaration d'adhésion</field> - <field name="coop_type_id" ref="cgscop_partner.form_lamaneur"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_lamaneur" /> + <field name="is_compulsory" eval="True" /> </record> <record id="lamaneur_mandat" model="scop.adhesion.file"> <field name="name">Lamaneur - Mandat de prélèvement SEPA</field> - <field name="coop_type_id" ref="cgscop_partner.form_lamaneur"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_lamaneur" /> + <field name="is_compulsory" eval="True" /> </record> <record id="lamaneur_rib" model="scop.adhesion.file"> <field name="name">Lamaneur - RIB (IBAN)</field> - <field name="coop_type_id" ref="cgscop_partner.form_lamaneur"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_lamaneur" /> + <field name="is_compulsory" eval="True" /> </record> <record id="lamaneur_bordereau" model="scop.adhesion.file"> <field name="name">Lamaneur - Bordereau de calcul des cotisations</field> - <field name="coop_type_id" ref="cgscop_partner.form_lamaneur"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_lamaneur" /> + <field name="is_compulsory" eval="True" /> </record> <record id="lamaneur_demande_inscri" model="scop.adhesion.file"> <field name="name">Lamaneur - Lettre de demande d'inscritption</field> - <field name="coop_type_id" ref="cgscop_partner.form_lamaneur"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_lamaneur" /> + <field name="is_compulsory" eval="True" /> </record> <record id="lamaneur_fiche_renseignements" model="scop.adhesion.file"> <field name="name">Lamaneur - Fiche de renseignements</field> - <field name="coop_type_id" ref="cgscop_partner.form_lamaneur"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_lamaneur" /> + <field name="is_compulsory" eval="True" /> </record> <record id="lamaneur_paiement" model="scop.adhesion.file"> <field name="name">Lamaneur - Chèque ou récépissé ordre de virement</field> - <field name="coop_type_id" ref="cgscop_partner.form_lamaneur"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_lamaneur" /> + <field name="is_compulsory" eval="True" /> </record> <record id="lamaneur_statuts" model="scop.adhesion.file"> <field name="name">Lamaneur - Statuts (en 2 exemplaires)</field> - <field name="coop_type_id" ref="cgscop_partner.form_lamaneur"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_lamaneur" /> + <field name="is_compulsory" eval="True" /> </record> <record id="lamaneur_pub" model="scop.adhesion.file"> <field name="name">Lamaneur - Annonce publicité légale</field> - <field name="coop_type_id" ref="cgscop_partner.form_lamaneur"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_lamaneur" /> + <field name="is_compulsory" eval="True" /> </record> <record id="lamaneur_kbis" model="scop.adhesion.file"> <field name="name">Lamaneur - Extrait Kbis</field> - <field name="coop_type_id" ref="cgscop_partner.form_lamaneur"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_lamaneur" /> + <field name="is_compulsory" eval="True" /> </record> - + <!-- SCIC--> <record id="scic_decla_adhesion" model="scop.adhesion.file"> <field name="name">SCIC - Déclaration d'adhésion</field> - <field name="coop_type_id" ref="cgscop_partner.form_scic"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scic" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scic_mandat" model="scop.adhesion.file"> <field name="name">SCIC - Mandat de prélèvement SEPA</field> - <field name="coop_type_id" ref="cgscop_partner.form_scic"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scic" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scic_rib" model="scop.adhesion.file"> <field name="name">SCIC - RIB (IBAN)</field> - <field name="coop_type_id" ref="cgscop_partner.form_scic"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scic" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scic_bordereau" model="scop.adhesion.file"> <field name="name">SCIC - Bordereau de calcul des cotisations</field> - <field name="coop_type_id" ref="cgscop_partner.form_scic"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scic" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scic_demande_inscri" model="scop.adhesion.file"> <field name="name">SCIC - Lettre de demande d'inscritption</field> - <field name="coop_type_id" ref="cgscop_partner.form_scic"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scic" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scic_fiche_renseignements" model="scop.adhesion.file"> <field name="name">SCIC - Fiche de renseignements</field> - <field name="coop_type_id" ref="cgscop_partner.form_scic"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scic" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scic_paiement" model="scop.adhesion.file"> <field name="name">SCIC - Chèque ou récépissé ordre de virement</field> - <field name="coop_type_id" ref="cgscop_partner.form_scic"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scic" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scic_statuts" model="scop.adhesion.file"> <field name="name">SCIC - Statuts (en 2 exemplaires)</field> - <field name="coop_type_id" ref="cgscop_partner.form_scic"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scic" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scic_pub" model="scop.adhesion.file"> <field name="name">SCIC - Annonce publicité légale</field> - <field name="coop_type_id" ref="cgscop_partner.form_scic"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scic" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scic_kbis" model="scop.adhesion.file"> <field name="name">SCIC - Extrait Kbis</field> - <field name="coop_type_id" ref="cgscop_partner.form_scic"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scic" /> + <field name="is_compulsory" eval="True" /> </record> - + <!-- SCOP--> <record id="scop_decla_adhesion" model="scop.adhesion.file"> <field name="name">SCOP - Déclaration d'adhésion</field> - <field name="coop_type_id" ref="cgscop_partner.form_scop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scop" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scop_mandat" model="scop.adhesion.file"> <field name="name">SCOP - Mandat de prélèvement SEPA</field> - <field name="coop_type_id" ref="cgscop_partner.form_scop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scop" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scop_rib" model="scop.adhesion.file"> <field name="name">SCOP - RIB (IBAN)</field> - <field name="coop_type_id" ref="cgscop_partner.form_scop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scop" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scop_bordereau" model="scop.adhesion.file"> <field name="name">SCOP - Bordereau de calcul des cotisations</field> - <field name="coop_type_id" ref="cgscop_partner.form_scop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scop" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scop_demande_inscri" model="scop.adhesion.file"> <field name="name">SCOP - Lettre de demande d'inscritption</field> - <field name="coop_type_id" ref="cgscop_partner.form_scop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scop" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scop_fiche_renseignements" model="scop.adhesion.file"> <field name="name">SCOP - Fiche de renseignements</field> - <field name="coop_type_id" ref="cgscop_partner.form_scop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scop" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scop_paiement" model="scop.adhesion.file"> <field name="name">SCOP - Chèque ou récépissé ordre de virement</field> - <field name="coop_type_id" ref="cgscop_partner.form_scop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scop" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scop_statuts" model="scop.adhesion.file"> <field name="name">SCOP - Statuts (en 2 exemplaires)</field> - <field name="coop_type_id" ref="cgscop_partner.form_scop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scop" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scop_pub" model="scop.adhesion.file"> <field name="name">SCOP - Annonce publicité légale</field> - <field name="coop_type_id" ref="cgscop_partner.form_scop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scop" /> + <field name="is_compulsory" eval="True" /> </record> <record id="scop_kbis" model="scop.adhesion.file"> <field name="name">SCOP - Extrait Kbis</field> - <field name="coop_type_id" ref="cgscop_partner.form_scop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_scop" /> + <field name="is_compulsory" eval="True" /> </record> - + <!-- Unionscop --> - <record id="coop_47_decla_adhesion" model="scop.adhesion.file"> + <record id="unionscop_decla_adhesion" model="scop.adhesion.file"> <field name="name">Unionscop - Déclaration d'adhésion</field> - <field name="coop_type_id" ref="cgscop_partner.form_unionscop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_unionscop" /> + <field name="is_compulsory" eval="True" /> </record> - <record id="coop_47_mandat" model="scop.adhesion.file"> + <record id="unionscop_mandat" model="scop.adhesion.file"> <field name="name">Unionscop - Mandat de prélèvement SEPA</field> - <field name="coop_type_id" ref="cgscop_partner.form_unionscop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_unionscop" /> + <field name="is_compulsory" eval="True" /> </record> - <record id="coop_47_rib" model="scop.adhesion.file"> + <record id="unionscop_rib" model="scop.adhesion.file"> <field name="name">Unionscop - RIB (IBAN)</field> - <field name="coop_type_id" ref="cgscop_partner.form_unionscop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_unionscop" /> + <field name="is_compulsory" eval="True" /> </record> - <record id="coop_47_bordereau" model="scop.adhesion.file"> + <record id="unionscop_bordereau" model="scop.adhesion.file"> <field name="name">Unionscop - Bordereau de calcul des cotisations</field> - <field name="coop_type_id" ref="cgscop_partner.form_unionscop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_unionscop" /> + <field name="is_compulsory" eval="True" /> </record> - <record id="coop_47_demande_inscri" model="scop.adhesion.file"> + <record id="unionscop_demande_inscri" model="scop.adhesion.file"> <field name="name">Unionscop - Lettre de demande d'inscritption</field> - <field name="coop_type_id" ref="cgscop_partner.form_unionscop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_unionscop" /> + <field name="is_compulsory" eval="True" /> </record> - <record id="coop_47_fiche_renseignements" model="scop.adhesion.file"> + <record id="unionscop_fiche_renseignements" model="scop.adhesion.file"> <field name="name">Unionscop - Fiche de renseignements</field> - <field name="coop_type_id" ref="cgscop_partner.form_unionscop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_unionscop" /> + <field name="is_compulsory" eval="True" /> </record> - <record id="coop_47_paiement" model="scop.adhesion.file"> + <record id="unionscop_paiement" model="scop.adhesion.file"> <field name="name">Unionscop - Chèque ou récépissé ordre de virement</field> - <field name="coop_type_id" ref="cgscop_partner.form_unionscop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_unionscop" /> + <field name="is_compulsory" eval="True" /> </record> - <record id="coop_47_statuts" model="scop.adhesion.file"> + <record id="unionscop_statuts" model="scop.adhesion.file"> <field name="name">Unionscop - Statuts (en 2 exemplaires)</field> - <field name="coop_type_id" ref="cgscop_partner.form_unionscop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_unionscop" /> + <field name="is_compulsory" eval="True" /> </record> - <record id="coop_47_pub" model="scop.adhesion.file"> + <record id="unionscop_pub" model="scop.adhesion.file"> <field name="name">Unionscop - Annonce publicité légale</field> - <field name="coop_type_id" ref="cgscop_partner.form_unionscop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_unionscop" /> + <field name="is_compulsory" eval="True" /> </record> - <record id="coop_47_kbis" model="scop.adhesion.file"> + <record id="unionscop_kbis" model="scop.adhesion.file"> <field name="name">Unionscop - Extrait Kbis</field> - <field name="coop_type_id" ref="cgscop_partner.form_unionscop"/> - <field name="is_compulsory" eval="True"/> + <field name="coop_type_id" ref="cgscop_partner.form_unionscop" /> + <field name="is_compulsory" eval="True" /> </record> </data> diff --git a/migration/14.0.1.0.0/post-migration.py b/migration/14.0.1.0.0/post-migration.py new file mode 100644 index 0000000000000000000000000000000000000000..deba91ee8ceff7c9ef3e399d697b513cf981da32 --- /dev/null +++ b/migration/14.0.1.0.0/post-migration.py @@ -0,0 +1,19 @@ +# © 2022 Le Filament (<http://www.le-filament.com>) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade # pylint: disable=W7936 + + +def res_partner_range_map_values(env): + openupgrade.map_values( + env.cr, + openupgrade.get_legacy_name("percent_realisation"), + "percent_realisation", + [(0, "0"), (20, "20"), (40, "40"), (60, "60"), (80, "80"), (100, "100")], + table="res_partner", + ) + + +@openupgrade.migrate() +def migrate(env, version): + res_partner_range_map_values(env) diff --git a/models/res_company.py b/models/res_company.py index ed1daea9e843f39f913db04859ed907ae66104e1..236b20e2c5aa960accf913aa4e016084f41ed7a1 100644 --- a/models/res_company.py +++ b/models/res_company.py @@ -5,16 +5,16 @@ from odoo import fields, models class ScopAdhesionCompany(models.Model): - _inherit = 'res.company' + _inherit = "res.company" - is_adhesion = fields.Boolean('Adhésions', default=False) + is_adhesion = fields.Boolean("Adhésions", default=False) product_adhesion_id = fields.Many2one( - comodel_name='product.product', - string='Article d\'adhésion', - domain="[('sale_ok', '=', True), ('company_id', '=', company_id)]" + comodel_name="product.product", + string="Article d'adhésion", + domain="[('sale_ok', '=', True), ('company_id', '=', company_id)]", ) journal_adhesion_id = fields.Many2one( - comodel_name='account.journal', - string='Journal des adhésions', + comodel_name="account.journal", + string="Journal des adhésions", domain="[('type', '=', 'sale')]", ) diff --git a/models/res_config_settings.py b/models/res_config_settings.py index d2343cd38e32fa7d7fabc56d6aea1655a72a3c40..47b32f6300c15305fd2d4d1e89433c46890c72a7 100644 --- a/models/res_config_settings.py +++ b/models/res_config_settings.py @@ -5,19 +5,16 @@ from odoo import fields, models class ScopAdhesionConfigSettings(models.TransientModel): - _inherit = 'res.config.settings' + _inherit = "res.config.settings" is_adhesion = fields.Boolean( - string='Adhésions', - related="company_id.is_adhesion", - readonly=False) + string="Adhésions", related="company_id.is_adhesion", readonly=False + ) product_adhesion_id = fields.Many2one( - comodel_name='product.product', related="company_id.product_adhesion_id", readonly=False, - string='Article d\'adhésion') + ) journal_adhesion_id = fields.Many2one( - comodel_name='account.journal', related="company_id.journal_adhesion_id", readonly=False, - string='Journal des adhésions') + ) diff --git a/models/res_partner.py b/models/res_partner.py index ebcda5cdf9a4b51f793cf18e209f44c7063ef39a..f339688d7cd5f9d1a221f0b2e6ce212d2d80864b 100644 --- a/models/res_partner.py +++ b/models/res_partner.py @@ -1,34 +1,33 @@ -# © 2019 Le Filament (<http://www.le-filament.com>) +# © 2022 Le Filament (<http://www.le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields, api -from odoo.exceptions import ValidationError from pytz import timezone +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + class ScopPartner(models.Model): _inherit = "res.partner" # Processus d'adhésion - project_number = fields.Char('N° Projet') + project_number = fields.Char("N° Projet") percent_realisation = fields.Selection( - [(0, 0), - (20, 20), - (40, 40), - (60, 60), - (80, 80), - (100, 100)], - string='Probabilité de réalisation') + [("0", 0), ("20", 20), ("40", 40), ("60", 60), ("80", 80), ("100", 100)], + string="Probabilité de réalisation", + ) date_realisation = fields.Date("Date prévue de réalisation") prescriber_canal_id = fields.Many2one( - 'res.partner.prescriber.canal', - string='Canal de Prescription', - on_delete='restrict') + "res.partner.prescriber.canal", + string="Canal de Prescription", + ondelete="restrict", + ) project_federation = fields.Many2one( - comodel_name='res.partner.federation', + comodel_name="res.partner.federation", string="Fédération", - on_delete='restrict', - track_visibility='onchange') + ondelete="restrict", + tracking=True, + ) date_first_rdv = fields.Date("Date du 1er rdv") is_first_rdv_infocoll = fields.Boolean("Réunion d'info. collective") @@ -41,26 +40,23 @@ class ScopPartner(models.Model): adhesion_comments = fields.Text("Commentaires Adhésion") feasibility_study = fields.Boolean("Etude de faisabilité signée / validée") - amount_feasibility_study = fields.Integer( - "Montant de l’étude de faisabilité") + amount_feasibility_study = fields.Integer("Montant de l’étude de faisabilité") date_prediag = fields.Date("Date de pré-diagnostic") date_convention = fields.Date("Date de signature de la convention") amount_convention = fields.Integer("Montant de la convention") file_full = fields.Boolean("Dossier d’adhésion complet") - date_transmission_cg = fields.Date( - "Date de transmission du dossier à la CG") + date_transmission_cg = fields.Date("Date de transmission du dossier à la CG") date_bureau_validation = fields.Date("Date du bureau de validation") lm_adhesion_id = fields.Many2one( - comodel_name='liste.ministere', - string='Liste Ministère adhésion') + comodel_name="scop.liste.ministere", string="Liste Ministère adhésion" + ) lm_adhesion_year = fields.Integer( - string="Année dossier adhésion", - related='lm_adhesion_id.year' + string="Année dossier adhésion", related="lm_adhesion_id.year" ) invoice_adhesion_id = fields.Many2one( - comodel_name='account.invoice', - string='Facture d\'adhésion') + comodel_name="account.move", string="Facture d'adhésion" + ) # Dossier UE file_fse_open = fields.Boolean("Dossier FSE ouvert Oui/Non") @@ -68,16 +64,18 @@ class ScopPartner(models.Model): date_return_file = fields.Date("Date de retour du dossier") fse_full = fields.Boolean("FSE Complet") recipient_file_fse = fields.Many2one( - 'res.partner', - string="Destinataire du dossier FSE") + "res.partner", string="Destinataire du dossier FSE" + ) project_invoicing_status_id = fields.Many2many( - 'res.partner.project.invoicing.status', - column1='partner_id', - column2='invoicing_status_id', - string='Etat de facturation') + "res.partner.project.invoicing.status", + column1="partner_id", + column2="invoicing_status_id", + string="Etat de facturation", + ) project_invoicing_status_nb = fields.Integer( string="Nb de statuts de facturation", - compute="_compute_project_invoicing_status_nb") + compute="_compute_project_invoicing_status_nb", + ) # Changement de statuts list_logs = fields.Text("Liste des erreurs") @@ -85,20 +83,20 @@ class ScopPartner(models.Model): # ------------------------------------------------------ # Compute function # ------------------------------------------------------ - @api.multi def _compute_project_invoicing_status_nb(self): for partner in self: # Calcul nombre de statut 1 - sta = partner.env['res.partner.project.invoicing.status'].search([ - ('ur_id', '=', self.env.user.ur_id.id)]) + sta = partner.env["res.partner.project.invoicing.status"].search( + [("ur_id", "=", self.env.user.ur_id.id)] + ) partner.project_invoicing_status_nb = len(sta) # ------------------------------------------------------ # Onchange function # ------------------------------------------------------ - @api.onchange('project_status') + @api.onchange("project_status") def _onchange_project_status(self): - if self.project_status != '7_abandonne': + if self.project_status != "7_abandonne": self.date_abort = None # ------------------------------------------------------ @@ -112,16 +110,15 @@ class ScopPartner(models.Model): self.ensure_one() if not self.lm_adhesion_id: self.lm_adhesion_id = self.get_lm_adhesion() - form_id = self.env.ref( - "cgscop_liste_ministere.view_liste_ministere_form") + form_id = self.env.ref("cgscop_liste_ministere.view_liste_ministere_form") action = { - 'name': 'Dossier d\'adhésion', - 'type': 'ir.actions.act_window', - 'res_model': 'liste.ministere', - 'view_mode': 'form', - 'views': [[form_id.id, 'form']], - 'res_id': self.lm_adhesion_id.id, - 'context': {'create': False, 'edit': True, 'delete': False} + "name": "Dossier d'adhésion", + "type": "ir.actions.act_window", + "res_model": "scop.liste.ministere", + "view_mode": "form", + "views": [[form_id.id, "form"]], + "res_id": self.lm_adhesion_id.id, + "context": {"create": False, "edit": True, "delete": False}, } return action @@ -136,17 +133,17 @@ class ScopPartner(models.Model): liasse_adhesion = self.get_liasse_adhesion(self.lm_adhesion_id) year_adhesion = self.lm_adhesion_year if not liasse_adhesion.year == year_adhesion: - liasse_adhesion.update({ - 'year': year_adhesion - }) + liasse_adhesion.update({"year": year_adhesion}) action = self.env.ref( - 'cgscop_liste_ministere.' - + 'scop_liasse_fiscale_previsionnelle_act_window').read()[0] - action.update({ - 'name': 'Données financières', - 'res_id': liasse_adhesion.id, - 'context': {'create': False, 'edit': True, 'delete': False} - }) + "cgscop_liasse_fiscale.scop_liasse_fiscale_previsionnelle_act_window" + ).read()[0] + action.update( + { + "name": "Données financières", + "res_id": liasse_adhesion.id, + "context": {"create": False, "edit": True, "delete": False}, + } + ) return action def scop_change_year_dossier(self): @@ -154,15 +151,16 @@ class ScopPartner(models.Model): Open wizard to change year dossier adhesion :return: """ - wizard = self.env['scop.adhesion.year.wizard']. \ - create({'lm_adhesion_id': self.lm_adhesion_id.id}) + wizard = self.env["scop.adhesion.year.wizard"].create( + {"lm_adhesion_id": self.lm_adhesion_id.id} + ) return { - 'name': "Modifier l'année du dossier", - 'type': 'ir.actions.act_window', - 'view_mode': 'form', - 'res_model': 'scop.adhesion.year.wizard', - 'res_id': wizard.id, - 'target': 'new' + "name": "Modifier l'année du dossier", + "type": "ir.actions.act_window", + "view_mode": "form", + "res_model": "scop.adhesion.year.wizard", + "res_id": wizard.id, + "target": "new", } # ------------------------------------------------------ @@ -184,27 +182,23 @@ class ScopPartner(models.Model): last_lm_ids = self.get_last_lm() year = fields.Date.today().year if not year else year if last_lm_ids: - lm_adhesion = last_lm_ids.filtered( - lambda lm: lm.year == year) + lm_adhesion = last_lm_ids.filtered(lambda lm: lm.year == year) if not lm_adhesion: if not last_lm_ids: - dossier_type_inscription_id = self.env.ref( - 'cgscop_liste_ministere.liste_ministere_type_1').id - type_lm = dossier_type_inscription_id + type_lm = "subscribe" else: - dossier_type_renouvellement_id = self.env.ref( - 'cgscop_liste_ministere.liste_ministere_type_2').id - type_lm = dossier_type_renouvellement_id - ListeMinistere = self.env['liste.ministere'] - lm_adhesion_id = ListeMinistere.sudo().\ - create_folder(self, year, type_lm) + type_lm = "renew" + ListeMinistere = self.env["scop.liste.ministere"] + lm_adhesion_id = ListeMinistere.sudo().create_folder( + self, year, type_lm + ) lm_adhesion = ListeMinistere.browse(lm_adhesion_id) lm_adhesion.action_publish_without_extranet() self.lm_adhesion_id = lm_adhesion.id else: if not lm_adhesion.active: - lm_adhesion.write({'active': True}) + lm_adhesion.write({"active": True}) return lm_adhesion @@ -213,11 +207,9 @@ class ScopPartner(models.Model): Return last known lm for partner """ self.ensure_one() - lm_ids = self.env['liste.ministere'].search([ - ('partner_id', '=', self.id), - ('active', 'in', [True, False]) - ], - order='year desc' + lm_ids = self.env["scop.liste.ministere"].search( + [("partner_id", "=", self.id), ("active", "in", [True, False])], + order="year desc", ) return lm_ids @@ -227,12 +219,10 @@ class ScopPartner(models.Model): :param lm: :return: """ - liasse_type_previ = 'forecast' + liasse_type_previ = "forecast" liasse_adhesion = lm.sudo().create_liasse_fiscale(liasse_type_previ) if not liasse_adhesion.revenue_cg: - liasse_adhesion.update({ - 'revenue_cg': self.ca_previsionnel - }) + liasse_adhesion.update({"revenue_cg": self.ca_previsionnel}) return liasse_adhesion def is_project_complete(self): @@ -252,17 +242,20 @@ class ScopPartner(models.Model): errors_str = str() for error in errors_complete_docs: errors_str += "<li>" + error + "</li>" - errors += '<hr/><strong>Documents manquants :</strong><ul>' + \ - errors_str + '</ul>' + errors += ( + "<hr/><strong>Documents manquants :</strong><ul>" + errors_str + "</ul>" + ) if errors: - local_tz = timezone('Europe/Paris') - utc_tz = timezone('UTC') - self.list_logs = \ - '<strong>' + utc_tz.localize( - fields.Datetime.now()).astimezone(local_tz).strftime( - "%d/%m/%Y - %-H:%M") + \ - '</strong> - Impossible de soumettre le dossier à la CG Scop' \ + local_tz = timezone("Europe/Paris") + utc_tz = timezone("UTC") + self.list_logs = ( + "<strong>" + + utc_tz.localize(fields.Datetime.now()) + .astimezone(local_tz) + .strftime("%d/%m/%Y - %-H:%M") + + "</strong> - Impossible de soumettre le dossier à la CG Scop" + errors + ) return False else: self.list_logs = False @@ -274,14 +267,18 @@ class ScopPartner(models.Model): :param lm: :return: """ - res = '' + res = "" errors_lm = lm.check_compulsory_fields_lm() if errors_lm: - res += '<hr/><strong>Dossier d\'Adhésion : </strong><ul>' + errors_lm + '</ul>' + res += ( + "<hr/><strong>Dossier d'Adhésion : </strong><ul>" + errors_lm + "</ul>" + ) liasse_adhesion = self.get_liasse_adhesion(lm) errors_lf = liasse_adhesion.check_compulsory_fields_lf() if errors_lf: - res += '<hr/><strong>Données financières :</strong><ul>' + errors_lf + '</ul>' + res += ( + "<hr/><strong>Données financières :</strong><ul>" + errors_lf + "</ul>" + ) return res def check_compulsory_docs(self): @@ -295,16 +292,14 @@ class ScopPartner(models.Model): else: return False - @api.multi def create_num_adherent(self): """ Generate new num adherent with sequence :return: """ self.ensure_one() - return self.env['ir.sequence'].next_by_code('scop.membership.period') + return self.env["ir.sequence"].next_by_code("scop.membership.period") - @api.multi def create_period_adhesion_cg(self, num_adherent): """ Create new period adhesion for type CG @@ -312,11 +307,10 @@ class ScopPartner(models.Model): :return: """ self.ensure_one() - type_id = self.env.ref('cgscop_partner.membership_type_1') + type_id = self.env.ref("cgscop_partner.membership_type_1") self.create_period_adhesion(type_id, num_adherent) return True - @api.multi def create_period_adhesion_fede(self, num_adherent): """ Create new period adhesion for type fédération if naf is linked to fede @@ -326,16 +320,16 @@ class ScopPartner(models.Model): self.ensure_one() fede = self.naf_id.federation_id - fede_com = self.env.ref('cgscop_adhesion.COM') - fede_indus = self.env.ref('cgscop_adhesion.IND') - fede_btp = self.env.ref('cgscop_adhesion.BTP') + fede_com = self.env.ref("cgscop_partner.COM") + fede_indus = self.env.ref("cgscop_partner.IND") + fede_btp = self.env.ref("cgscop_partner.BTP") if fede == fede_com: - type_id = self.env.ref('cgscop_partner.membership_type_2') + type_id = self.env.ref("cgscop_partner.membership_type_2") elif fede == fede_indus: - type_id = self.env.ref('cgscop_partner.membership_type_3') + type_id = self.env.ref("cgscop_partner.membership_type_3") elif fede == fede_btp: - type_id = self.env.ref('cgscop_partner.membership_type_4') + type_id = self.env.ref("cgscop_partner.membership_type_4") else: type_id = None if type_id: @@ -344,7 +338,6 @@ class ScopPartner(models.Model): else: return False - @api.multi def create_period_adhesion(self, type_id, number): """ Generic function to create period adhesion with type and number @@ -353,22 +346,26 @@ class ScopPartner(models.Model): :return: """ date = self.date_bureau_validation or fields.Date.today() - if self.env['scop.membership.period'].search( - [('partner_id', '=', self.id), - ('end', '=', False), ('type_id', '=', type_id.id)], - limit=1): - raise ValidationError( - "Une période d'adhésion existe déjà pour ce type") + if self.env["scop.membership.period"].search( + [ + ("partner_id", "=", self.id), + ("end", "=", False), + ("type_id", "=", type_id.id), + ], + limit=1, + ): + raise ValidationError(_("Une période d'adhésion existe déjà pour ce type")) else: - self.env['scop.membership.period'].create({ - 'partner_id': self.id, - 'type_id': type_id.id, - 'start': date, - 'start_stat': date, - 'number': number - }) - - @api.multi + self.env["scop.membership.period"].create( + { + "partner_id": self.id, + "type_id": type_id.id, + "start": date, + "start_stat": date, + "number": number, + } + ) + def create_invoice_adhesion(self, lm): """ Crée une facture d'adhésion avec l'article et le journal configurés @@ -379,42 +376,46 @@ class ScopPartner(models.Model): :return: """ self.ensure_one() - product_id = self.env.user.company_id.product_adhesion_id - journal_id = self.env.user.company_id.journal_adhesion_id + product_id = self.env.company.product_adhesion_id + journal_id = self.env.company.journal_adhesion_id if not (product_id or journal_id): raise ValidationError( - "Vous devez configurer un article et un journal d'adhésion !") + _("Vous devez configurer un article et un journal d'adhésion !") + ) else: effectif = lm.eff_tt amount_adhesion = self.get_amount_adhesion(effectif) - Invoice = self.env['account.invoice'] - InvoiceLine = self.env['account.invoice.line'] + Invoice = self.env["account.move"] date_invoice = self.date_bureau_validation or fields.Date.today() - account_id = self.property_account_receivable_id - adhesion_invoice = Invoice.create({ - 'partner_id': self.id, - 'type': 'out_invoice', - 'journal_id': journal_id.id, - 'state': 'draft', - 'account_id': account_id.id, - 'date_invoice': date_invoice, - }) - - InvoiceLine.create({ - 'invoice_id': adhesion_invoice.id, - 'product_id': product_id.id, - 'account_id': product_id.property_account_income_id.id, - 'invoice_line_tax_ids': [(6, 0, product_id.taxes_id.ids)], - 'name': product_id.name, - 'price_unit': amount_adhesion - }) - adhesion_invoice.action_invoice_open() + adhesion_invoice = Invoice.create( + { + "partner_id": self.id, + "move_type": "out_invoice", + "journal_id": journal_id.id, + "state": "draft", + "invoice_date": date_invoice, + "invoice_line_ids": [ + ( + 0, + None, + { + "product_id": product_id.id, + "account_id": product_id.property_account_income_id.id, + "tax_ids": [(6, 0, product_id.taxes_id.ids)], + "name": product_id.name, + "price_unit": amount_adhesion, + "price_subtotal": amount_adhesion, + }, + ), + ], + } + ) + adhesion_invoice.action_post() return adhesion_invoice - @api.multi def get_amount_adhesion(self, effectif): """ Return amount adhésion thanks to effectif @@ -431,9 +432,8 @@ class ScopPartner(models.Model): # ------------------------------------------------------ # Override parent / Change of status # ------------------------------------------------------ - @api.multi def scop_send_to_cg(self): - """ Hérite la fonction d'envoi de l'organisme à la CG + """Hérite la fonction d'envoi de l'organisme à la CG pour validation afin de : - vérifier si le dossier d'adhésion est complet - positionner la date_transmission_cg avec la date du jour @@ -448,17 +448,13 @@ class ScopPartner(models.Model): message = "Le dossier d'adhésion a été transmis à la CG Scop" else: message = self.list_logs - message_id = self.env['message.wizard'].create({'message': message}) return { - 'name': "Transmission du dossier d'Adhésion", - 'type': 'ir.actions.act_window', - 'view_mode': 'form', - 'res_model': 'message.wizard', - 'res_id': message_id.id, - 'target': 'new', + "type": "ir.actions.act_window.message", + "title": _("Transmission du dossier d'Adhésion"), + "is_html_message": True, + "message": _(message), } - @api.multi def scop_abandonne(self): """ Hérite la fonction d'abandon pour déterminer la date @@ -469,24 +465,24 @@ class ScopPartner(models.Model): self.date_abort = fields.Date.today() return True - @api.multi def scop_suivi_non_adhesion(self): """ Passe la coop en statut suivi sans devenir adhérente """ - wizard = self.env['scop.compulsory.fields.suivi.wizard'].create({ - 'partner_id': self.id, - }) + wizard = self.env["scop.compulsory.fields.suivi.wizard"].create( + { + "partner_id": self.id, + } + ) return { - 'name': "Confirmation des champs obligatoires", - 'type': 'ir.actions.act_window', - 'view_mode': 'form', - 'res_model': 'scop.compulsory.fields.suivi.wizard', - 'res_id': wizard.id, - 'target': 'new', + "name": "Confirmation des champs obligatoires", + "type": "ir.actions.act_window", + "view_mode": "form", + "res_model": "scop.compulsory.fields.suivi.wizard", + "res_id": wizard.id, + "target": "new", } - @api.multi def scop_valid_cg(self): """ Inherit function to : @@ -498,7 +494,8 @@ class ScopPartner(models.Model): if not self.lm_adhesion_id: raise ValidationError( - 'Cette coopérative n\'a pas de dossier d\'inscription') + _("Cette coopérative n'a pas de dossier d'inscription") + ) res = super(ScopPartner, self).scop_valid_cg() @@ -513,9 +510,7 @@ class ScopPartner(models.Model): self.invoice_adhesion_id = invoice # set liasse_fiscale_adhesion as qualified - self.lm_adhesion_id.scop_liasse_fiscale_id.write({ - 'is_qualified': True - }) + self.lm_adhesion_id.scop_liasse_fiscale_id.write({"is_qualified": True}) return res @@ -524,4 +519,4 @@ class ResPartnerPrescriberCanal(models.Model): _name = "res.partner.prescriber.canal" _description = "Canal de Prescription" - name = fields.Char('Canal de Prescription') + name = fields.Char("Canal de Prescription") diff --git a/models/res_partner_project_invoicing_status.py b/models/res_partner_project_invoicing_status.py index 442a1a04329e9c1e72fdc2b299132de4e4c9797c..ac9586b46cbd04608b5557d9f3829d239672de5f 100644 --- a/models/res_partner_project_invoicing_status.py +++ b/models/res_partner_project_invoicing_status.py @@ -1,23 +1,22 @@ # © 2019 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 fields, models class ResPartnerProjectInvoicingStatus(models.Model): _name = "res.partner.project.invoicing.status" _description = "Etat de la facturation projet" - _order = 'ur_id, name' + _order = "ur_id, name" def _default_ur(self): - return self.env['res.company']._ur_default_get() + return self.env["res.company"]._ur_default_get() - name = fields.Char('Nom', index=True, required=True) + name = fields.Char("Nom", index=True, required=True) ur_id = fields.Many2one( - 'union.regionale', - string='Union Régionale', + "union.regionale", + string="Union Régionale", index=True, - on_delete='restrict', - default=_default_ur) - - + ondelete="restrict", + default=_default_ur, + ) diff --git a/models/scop_adhesion_file.py b/models/scop_adhesion_file.py index 4e6926c3fbfcc42dbd1cd44ce103615252ec6f78..9567c168a5be04bc45965ddca6b4abd7e99ab2d4 100644 --- a/models/scop_adhesion_file.py +++ b/models/scop_adhesion_file.py @@ -5,11 +5,12 @@ from odoo import fields, models class ScopAdhesionFiles(models.Model): - _name = 'scop.adhesion.file' - _description = 'Documents pour adhésion des coops' + _name = "scop.adhesion.file" + _description = "Documents pour adhésion des coops" - name = fields.Char('Nom du fichier') + name = fields.Char("Nom du fichier") coop_type_id = fields.Many2one( - comodel_name='res.partner.cooperative.form', - string='Type de coopérative') - is_compulsory = fields.Boolean('Obligatoire') + comodel_name="res.partner.cooperative.form", + string="Type de coopérative", + ) + is_compulsory = fields.Boolean("Obligatoire") diff --git a/models/scop_liasse_fiscale.py b/models/scop_liasse_fiscale.py index b64548c7dd289ad9933f135e14801f4bb183c834..d519131da56a6e61c19e34335ac5de7a74a1f749 100644 --- a/models/scop_liasse_fiscale.py +++ b/models/scop_liasse_fiscale.py @@ -19,9 +19,15 @@ class ScopAdhesionLiasseFiscale(models.Model): - VABDF sens CGSCOP-Subv :return: errors if exist """ - if self.revenue_cg == 0 and self.revenue_cgsubv == 0 \ - and self.av_cg == 0 and self.av_cgsubv == 0: - return '<li> Les données financières ne sont pas renseignées correctement ' \ - '(CA ou VA obligatoire)</li>' + if ( + self.revenue_cg == 0 + and self.revenue_cgsubv == 0 + and self.av_cg == 0 + and self.av_cgsubv == 0 + ): + return ( + "<li> Les données financières ne sont pas renseignées correctement " + "(CA ou VA obligatoire)</li>" + ) else: return str() diff --git a/models/scop_liste_ministere.py b/models/scop_liste_ministere.py index 4ee265aa8fbaa6a99448023aff16b0f9fb68b69d..de8cd1612c85ffd624d565748b1515e3811b7041 100644 --- a/models/scop_liste_ministere.py +++ b/models/scop_liste_ministere.py @@ -5,7 +5,7 @@ from odoo import models class ScopAdhesionListeMinistere(models.Model): - _inherit = "liste.ministere" + _inherit = "scop.liste.ministere" # ------------------------------------------------------ # Validation de la saisie LM avant chgt statut @@ -35,9 +35,11 @@ class ScopAdhesionListeMinistere(models.Model): error |= self.date_1st_sign is False error |= self.closeout_month is False if error: - return '<li>Fiche signalétique : Vérifier que la date de ' \ - 'signature en Coop, l\'objet social et le mois de ' \ - 'cloture sont correctement renseignés</li>' + return ( + "<li>Fiche signalétique : Vérifier que la date de " + "signature en Coop, l'objet social et le mois de " + "cloture sont correctement renseignés</li>" + ) else: return str() @@ -47,8 +49,10 @@ class ScopAdhesionListeMinistere(models.Model): """ error = len(self.director_ids) == 0 if error: - return '<li>Membres du CA / Dirigeants : Aucun dirigeant n\'a ' \ - 'été renseigné</li>' + return ( + "<li>Membres du CA / Dirigeants : Aucun dirigeant n'a " + "été renseigné</li>" + ) else: return str() @@ -59,8 +63,10 @@ class ScopAdhesionListeMinistere(models.Model): """ error = self.cap_tt == 0 if error: - return '<li>Capital et Sociétariat : Le calcul [nombre de parts ' \ - '* valeur nominale] n\'a pas été renseigné</li>' + return ( + "<li>Capital et Sociétariat : Le calcul [nombre de parts " + "* valeur nominale] n'a pas été renseigné</li>" + ) else: return str() @@ -73,15 +79,17 @@ class ScopAdhesionListeMinistere(models.Model): """ error = False if self.partner_id.cooperative_form_id not in ( - self.env.ref('cgscop_partner.form_scic'), - self.env.ref('cgscop_partner.form_coop47'), + self.env.ref("cgscop_partner.form_scic"), + self.env.ref("cgscop_partner.form_coop47"), ): error = self.cap_sal_assoc_computed == 0 error |= self.eff_tt == 0 if error: - return '<li>Démographie : Vérifier que tous les champs de ' \ - 'l\'onglet "Démographie" sont bien renseignés '\ - '(capital par tranche d\'age et effectif total)</li>' + return ( + "<li>Démographie : Vérifier que tous les champs de " + 'l\'onglet "Démographie" sont bien renseignés ' + "(capital par tranche d'age et effectif total)</li>" + ) else: return str() @@ -94,11 +102,20 @@ class ScopAdhesionListeMinistere(models.Model): """ error = False if self.partner_id.cooperative_form_id != self.env.ref( - 'cgscop_partner.form_scic'): - error = self.part_reserve_legale + self.part_fond_developpement + \ - self.part_capital + self.part_travail + self.part_autres > 100 + "cgscop_partner.form_scic" + ): + error = ( + self.part_reserve_legale + + self.part_fond_developpement + + self.part_capital + + self.part_travail + + self.part_autres + > 100 + ) if error: - return '<li>Clés de répartition des bénéfices : ' \ - 'La somme ne peut pas être supérieure à 100</li>' + return ( + "<li>Clés de répartition des bénéfices : " + "La somme ne peut pas être supérieure à 100</li>" + ) else: return str() diff --git a/report/report_scop_adhesion.xml b/report/report_scop_adhesion.xml index de750b18d01e66ad0586ae397677899c7caeda6f..2484d5e0ccb09e74729afd287881fcf1591702ca 100644 --- a/report/report_scop_adhesion.xml +++ b/report/report_scop_adhesion.xml @@ -1,41 +1,58 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> <odoo> <data> <template id="report_adhesion_document"> <t t-call="web.external_layout"> <t t-set="o" t-value="o.with_context(lang='fr')" /> - <div class="page" style="font-size: 16px;" > + <div class="page" style="font-size: 16px;"> <div class="row"> <div class="col-6 offset-6 mt64 mb64"> - <span t-field="o.name" style="text-transform: uppercase; font-weight: 600;"/><br/> - <span t-field="o.street"/><br/> - <t t-if="o.street2"><span t-field="o.street2"/><br/></t> - <t t-if="o.street3"><span t-field="o.street3"/><br/></t> - <span t-field="o.zip" /> <span t-field="o.city" style="text-transform: uppercase;"/> - <t t-if="o.cedex"> <span t-field="o.cedex"/></t> + <span + t-field="o.name" + style="text-transform: uppercase; font-weight: 600;" + /><br /> + <span t-field="o.street" /><br /> + <t t-if="o.street2"><span t-field="o.street2" /><br /></t> + <t t-if="o.street3"><span t-field="o.street3" /><br /></t> + <span t-field="o.zip" /> <span + t-field="o.city" + style="text-transform: uppercase;" + /> + <t t-if="o.cedex"> <span t-field="o.cedex" /></t> </div> </div> <div class="row"> <div class="col-6 offset-6 mb16"> <p> Paris, le - <span t-esc="datetime.datetime.now()" t-options="{'widget': 'date', 'format': 'd MMMM YYYY'}"/> + <span + t-esc="datetime.datetime.now()" + t-options="{'widget': 'date', 'format': 'd MMMM YYYY'}" + /> </p> </div> </div> <div class="row mb16 ml16"> <div class="col-10 offset-1" style="text-align: justify;"> <p> - <strong>N° adhérent : <t t-esc="str(o.member_number_int)"/></strong><br/> - <strong>UR : <t t-esc="str(o.ur_id.name)"/></strong><br/> + <strong>N° adhérent : <t + t-esc="str(o.member_number_int)" + /></strong><br /> + <strong>UR : <t t-esc="str(o.ur_id.name)" /></strong><br + /> </p> <p> Chère Coopératrice, Cher Coopérateur, </p> <p> - J’ai le plaisir de vous informer que l’adhésion définitive de votre coopérative à la <strong>Confédération Générale des Scop</strong> a été validée par le Bureau de la Direction Nationale<t t-if="o.date_bureau_validation"><span> </span> qui s’est réuni le <span t-field="o.date_bureau_validation"/></t>. + J’ai le plaisir de vous informer que l’adhésion définitive de votre coopérative à la <strong + >Confédération Générale des Scop</strong> a été validée par le Bureau de la Direction Nationale<t + t-if="o.date_bureau_validation" + ><span> </span> qui s’est réuni le <span + t-field="o.date_bureau_validation" + /></t>. </p> <p> L’ensemble des membres de la Direction Nationale se réjouit de voir votre coopérative rejoindre le Réseau des Scop, riche de plus de 3 600 entreprises et 67 000 salariés, et participer activement à la vie de notre Mouvement, à son dynamisme et son rayonnement. @@ -69,23 +86,21 @@ <template id="report_adhesion"> <t t-call="web.html_container"> - <t t-set="docs" t-value="docs.with_context(lang='fr')"/> - <t t-set="company" t-value="docs.env.user.company_id"/> + <t t-set="docs" t-value="docs.with_context(lang='fr')" /> + <t t-set="company" t-value="docs.env.user.company_id" /> <t t-foreach="docs" t-as="o"> - <t t-call="cgscop_adhesion.report_adhesion_document" t-lang="fr"/> + <t t-call="cgscop_adhesion.report_adhesion_document" t-lang="fr" /> </t> </t> </template> <!-- QWeb Reports --> - <report - id="cgscop_adhesion_report" - model="res.partner" - string="Courrier d'adhésion" - report_type="qweb-pdf" - name="cgscop_adhesion.report_adhesion" - menu="False" - /> + <record id="cgscop_adhesion_report" model="ir.actions.report"> + <field name="model">res.partner</field> + <field name="name">Courrier d'adhésion</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">cgscop_adhesion.report_adhesion</field> + </record> </data> </odoo> diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv index 828d7d06f8a159e419218d2eacdab71e1ed71f67..a195250d08d60cfea946afbc8f5a6ad07ac26287 100644 --- a/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -1,9 +1,9 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_res_partner_prescriber_canal,access_res_partner_prescriber_canal,model_res_partner_prescriber_canal,base.group_user,1,0,0,0 admin_res_partner_prescriber_canal,admin_res_partner_prescriber_canal,model_res_partner_prescriber_canal,cgscop_partner.group_cg_administrator,1,1,1,1 -access_res_partner_federation,access_res_partner_federation,model_res_partner_federation,base.group_user,1,0,0,0 -admin_res_partner_federation,admin_res_partner_federation,model_res_partner_federation,cgscop_partner.group_cg_administrator,1,1,1,1 access_res_partner_project_invoicing_status,access_res_partner_project_invoicing_status,model_res_partner_project_invoicing_status,base.group_user,1,0,0,0 admin_res_partner_project_invoicing_status,admin_res_partner_project_invoicing_status,model_res_partner_project_invoicing_status,cgscop_partner.group_cg_administrator,1,1,1,1 access_scop_adhesion_file,access_scop_adhesion_file,model_scop_adhesion_file,base.group_user,1,0,0,0 admin_scop_adhesion_file,admin_scop_adhesion_file,model_scop_adhesion_file,cgscop_partner.group_cg_administrator,1,1,1,1 +cg_access_compulsory_fields_suivi_wizard,cg_access_compulsory_fields_suivi_wizard,model_scop_compulsory_fields_suivi_wizard,cgscop_partner.group_cg_administrative,1,1,1,0 +cg_access_adhesion_year_wizard,cg_access_adhesion_year_wizard,model_scop_adhesion_year_wizard,cgscop_partner.group_cg_administrative,1,1,1,0 diff --git a/static/src/js/basic_fields.js b/static/src/js/basic_fields.js index 60c4990b3af138f1155b94b68cb0aa4b24cca86b..4d0dc05247fc83aa4356398e8ed8a2d015248e35 100644 --- a/static/src/js/basic_fields.js +++ b/static/src/js/basic_fields.js @@ -1,49 +1,56 @@ -odoo.define('cgscop_adhesion.basic_fields', function (require) { -"use strict"; - -var AbstractField = require('web.AbstractField'); -var fieldRegistry = require('web.field_registry'); - -var PriorityWidgetCG = AbstractField.extend({ - className: "o_priority", - events: { - 'click > a': '_onClick', - }, - supportedFieldTypes: ['selection'], - - isSet: function () { - return true; - }, - - _render: function () { - var self = this; - var index_value = this.value ? _.findIndex(this.field.selection, function (v) { - return v[0] === self.value; - }) : 0; - this.$el.empty(); - this.empty_value = this.field.selection[0][0]; - _.each(this.field.selection.slice(1), function (choice, index) { - self.$el.append(self._renderStar('<a href="#">', index_value >= index+1, index+1, choice[1])); - }); - }, - - _renderStar: function (tag, isFull, index, tip) { - return $(tag) - .attr('title', tip) - .attr('aria-label', tip) - .attr('data-index', index) - .addClass('o_priority_star fa') - .toggleClass('fa-star', isFull) - .toggleClass('fa-star-o', !isFull); - }, - - _onClick: function (event) { - event.preventDefault(); - event.stopPropagation(); - }, - -}); - -fieldRegistry.add('prioritycg', PriorityWidgetCG); - +odoo.define("cgscop_adhesion.basic_fields", function (require) { + "use strict"; + + var AbstractField = require("web.AbstractField"); + var fieldRegistry = require("web.field_registry"); + + var PriorityWidgetCG = AbstractField.extend({ + className: "o_priority", + events: { + "click > a": "_onClick", + }, + supportedFieldTypes: ["selection"], + + isSet: function () { + return true; + }, + + _render: function () { + var self = this; + var index_value = this.value + ? _.findIndex(this.field.selection, function (v) { + return v[0] === self.value; + }) + : 0; + this.$el.empty(); + this.empty_value = this.field.selection[0][0]; + _.each(this.field.selection.slice(1), function (choice, index) { + self.$el.append( + self._renderStar( + '<a href="#">', + index_value >= index + 1, + index + 1, + choice[1] + ) + ); + }); + }, + + _renderStar: function (tag, isFull, index, tip) { + return $(tag) + .attr("title", tip) + .attr("aria-label", tip) + .attr("data-index", index) + .addClass("o_priority_star fa") + .toggleClass("fa-star", isFull) + .toggleClass("fa-star-o", !isFull); + }, + + _onClick: function (event) { + event.preventDefault(); + event.stopPropagation(); + }, + }); + + fieldRegistry.add("prioritycg", PriorityWidgetCG); }); diff --git a/views/assets.xml b/views/assets.xml index 6458ceac2bca6b3d6156670b852683216a5b012f..68a2b8f2874c94dc1f5e3a7dcd20bf4e45844fa7 100644 --- a/views/assets.xml +++ b/views/assets.xml @@ -1,13 +1,19 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <!-- Copyright 2019 Le Filament - License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> - +License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <template id="cgscop_assets_backend" name="account assets" inherit_id="web.assets_backend"> + <template + id="cgscop_assets_backend" + name="account assets" + inherit_id="web.assets_backend" + > <xpath expr="." position="inside"> - <script type="text/javascript" src="/cgscop_adhesion/static/src/js/basic_fields.js"/> - </xpath> + <script + type="text/javascript" + src="/cgscop_adhesion/static/src/js/basic_fields.js" + /> + </xpath> </template> -</odoo> \ No newline at end of file +</odoo> diff --git a/views/res_config_settings.xml b/views/res_config_settings.xml index ec3a54e1c0d090e9c4e6a5924705b7f221ce4d4b..14ad190d1d8e602ac823629d54bd95a330f66098 100644 --- a/views/res_config_settings.xml +++ b/views/res_config_settings.xml @@ -1,14 +1,14 @@ -<?xml version="1.0" encoding="UTF-8"?> +<?xml version="1.0" encoding="UTF-8" ?> <odoo> <data> <record id="res_config_settings_view_form_cotisations" model="ir.ui.view"> <field name="name">res.config.settings.view.form.inherit.cotisations</field> <field name="model">res.config.settings</field> - <field name="priority" eval="25"/> - <field name="inherit_id" ref="account.res_config_settings_view_form"/> + <field name="priority" eval="25" /> + <field name="inherit_id" ref="account.res_config_settings_view_form" /> <field name="arch" type="xml"> - <xpath expr="//div[@id='setup']" position="after"> + <xpath expr="//div[@data-key='account']" position="inside"> <h2>Adhésions</h2> <div class="row mt16 o_settings_container" name="contribution"> <div class="col-xs-12 col-md-6 o_setting_box"> @@ -16,25 +16,37 @@ <field name="is_adhesion" /> </div> <div class="o_setting_right_pane"> - <label for="is_adhesion"/> + <label for="is_adhesion" /> <div class="text-muted"> Activer la gestion des adhésions pour cette société </div> </div> - <div class="o_setting_left_pane"/> - <div class="o_setting_right_pane" attrs="{'invisible': [('is_adhesion', '=', False)]}"> - <label for="product_adhesion_id"/> + <div class="o_setting_left_pane" /> + <div + class="o_setting_right_pane" + attrs="{'invisible': [('is_adhesion', '=', False)]}" + > + <label for="product_adhesion_id" /> <div class="text-muted"> Article facturable pour les adhésions </div> - <field name="product_adhesion_id" attrs="{'required': [('is_adhesion', '=', True)]}"/> + <field + name="product_adhesion_id" + attrs="{'required': [('is_adhesion', '=', True)]}" + /> </div> - <div class="o_setting_right_pane" attrs="{'invisible': [('is_adhesion', '=', False)]}"> - <label for="journal_adhesion_id"/> + <div + class="o_setting_right_pane" + attrs="{'invisible': [('is_adhesion', '=', False)]}" + > + <label for="journal_adhesion_id" /> <div class="text-muted"> Journal pour les adhésions </div> - <field name="journal_adhesion_id" attrs="{'required': [('is_adhesion', '=', True)]}"/> + <field + name="journal_adhesion_id" + attrs="{'required': [('is_adhesion', '=', True)]}" + /> </div> </div> </div> @@ -43,4 +55,4 @@ </record> </data> -</odoo> \ No newline at end of file +</odoo> diff --git a/views/res_partner.xml b/views/res_partner.xml index ce7bb0b2a52bbee936be5cd36281711274c0cf09..8600a3d2efdf248571dec90127e3a177e0524374 100644 --- a/views/res_partner.xml +++ b/views/res_partner.xml @@ -1,7 +1,6 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <!-- Copyright 2019 Le Filament License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> - <odoo> <data> <!-- ****************************** @@ -13,14 +12,21 @@ <record id="view_partner_cooperative_adhesion_kanban" model="ir.ui.view"> <field name="name">cooperative.kanban.adhesion</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="//kanban/field[@name='type']" position="after"> - <field name="percent_realisation"/> + <field name="percent_realisation" /> </xpath> - <xpath expr="//div[hasclass('oe_kanban_partner_links')]" position="after"> + <xpath + expr="//span[hasclass('oe_kanban_partner_links')]" + position="after" + > <div> - <field name="percent_realisation" widget="prioritycg" readonly="1"/> + <field + name="percent_realisation" + widget="prioritycg" + readonly="1" + /> </div> </xpath> </field> @@ -29,122 +35,237 @@ <record id="view_partner_cooperative_adhesion_form" model="ir.ui.view"> <field name="name">cooperative.adhesion.form</field> <field name="model">res.partner</field> - <field name="inherit_id" ref="cgscop_partner.scop_contact_view_form"/> - <field name="priority" eval="1"/> + <field name="inherit_id" ref="cgscop_partner.scop_contact_view_form" /> + <field name="priority" eval="1" /> <field name="arch" type="xml"> <page name='scop_contacts' position="before"> - <page name="adhesion_processus1" string="Processus d'Adhésion" attrs="{'invisible': ['|', ('is_cooperative', '!=', True), ('project_status','=','6_suivi')]}"> + <page + name="adhesion_processus1" + string="Processus d'Adhésion" + attrs="{'invisible': ['|', ('is_cooperative', '!=', True), ('project_status','=','6_suivi')]}" + > <header> - <button string="Dossier d'adhésion" type="object" name="scop_lm_adhesion" class="btn-info" - attrs="{'invisible': ['|', ('project_status', '!=', '4_adhesion'), ('cooperative_form_id', 'in', (%(cgscop_partner.form_scic)d, %(cgscop_partner.form_coop47)d))]}"/> - <button string="Dossier d'inscription" type="object" name="scop_lm_adhesion" class="btn-info" - attrs="{'invisible': ['|', ('project_status', '!=', '4_adhesion'), ('cooperative_form_id', 'not in', (%(cgscop_partner.form_scic)d, %(cgscop_partner.form_coop47)d))]}"/> - <button string="Données financières" type="object" name="scop_liasse_adhesion" class="btn-info" - attrs="{'invisible': [('project_status', '!=', '4_adhesion')]}"/> - <button string="Modifier l'année du dossier" type="object" name="scop_change_year_dossier" class="btn-warning" - attrs="{'invisible': ['|', ('project_status', '!=', '4_adhesion'), ('lm_adhesion_id', '=', False)]}" - groups="cgscop_partner.group_cg_administrator"/> + <button + string="Dossier d'adhésion" + type="object" + name="scop_lm_adhesion" + class="btn-info" + attrs="{'invisible': ['|', ('project_status', '!=', '4_adhesion'), ('cooperative_form_id', 'in', (%(cgscop_partner.form_scic)d, %(cgscop_partner.form_coop47)d))]}" + /> + <button + string="Dossier d'inscription" + type="object" + name="scop_lm_adhesion" + class="btn-info" + attrs="{'invisible': ['|', ('project_status', '!=', '4_adhesion'), ('cooperative_form_id', 'not in', (%(cgscop_partner.form_scic)d, %(cgscop_partner.form_coop47)d))]}" + /> + <button + string="Données financières" + type="object" + name="scop_liasse_adhesion" + class="btn-info" + attrs="{'invisible': [('project_status', '!=', '4_adhesion')]}" + /> + <button + string="Modifier l'année du dossier" + type="object" + name="scop_change_year_dossier" + class="btn-warning" + attrs="{'invisible': ['|', ('project_status', '!=', '4_adhesion'), ('lm_adhesion_id', '=', False)]}" + groups="cgscop_partner.group_cg_administrator" + /> </header> - <div class="alert alert-danger" role="alert" attrs="{'invisible':['|', '|', ('write_date', '=', False), ('list_logs', '=', False), ('project_status', 'not in', ('4_adhesion', '5_cg'))]}"> - <field class="o_field_header" name="list_logs" readonly="1" widget="html"/> + <div + class="alert alert-danger" + role="alert" + attrs="{'invisible':['|', '|', ('write_date', '=', False), ('list_logs', '=', False), ('project_status', 'not in', ('4_adhesion', '5_cg'))]}" + > + <field + class="o_field_header" + name="list_logs" + readonly="1" + widget="html" + /> </div> - <field name="project_invoicing_status_nb" invisible="1"/> + <field name="project_invoicing_status_nb" invisible="1" /> <group col="3"> <group string="Général"> - <field name="project_number"/> + <field name="project_number" /> <field name="percent_realisation" widget="priority" /> - <field name="date_realisation"/> - <field name="prescriber_canal_id" options="{'no_create': True, 'no_open': True}"/> - <field name="project_federation" options="{'no_create': True, 'no_open': True}"/> - <field name="staff_existing"/> - <field name="staff_planned"/> - <field name="ca_previsionnel" widget="monetary"/> - <field name="date_abort" attrs="{'invisible':[('project_status','!=','7_abandonne')], 'required':[('project_status','=','7_abandonne')]}"/> - <field name="abort_comments" attrs="{'invisible':[('project_status','!=','7_abandonne')], 'required':[('project_status','=','7_abandonne')]}"/> + <field name="date_realisation" /> + <field + name="prescriber_canal_id" + options="{'no_create': True, 'no_open': True}" + /> + <field + name="project_federation" + options="{'no_create': True, 'no_open': True}" + /> + <field name="staff_existing" /> + <field name="staff_planned" /> + <field name="ca_previsionnel" widget="monetary" /> + <field + name="date_abort" + attrs="{'invisible':[('project_status','!=','7_abandonne')], 'required':[('project_status','=','7_abandonne')]}" + /> + <field + name="abort_comments" + attrs="{'invisible':[('project_status','!=','7_abandonne')], 'required':[('project_status','=','7_abandonne')]}" + /> </group> <group string="Dossier UE"> - <field name="file_fse_open" widget="boolean_toggle"/> - <field name="date_return_file"/> - <field name="fse_full" widget="boolean_toggle"/> - <field name="is_id_card" widget="boolean_toggle"/> - <field name="recipient_file_fse"/> - <field name="project_invoicing_status_id" widget="many2many_tags" options="{'no_create': True}" domain="[('ur_id', '=', ur_id)]" attrs="{'invisible':[('project_invoicing_status_nb', '=', 0)]}" /> + <field name="file_fse_open" widget="boolean_toggle" /> + <field name="date_return_file" /> + <field name="fse_full" widget="boolean_toggle" /> + <field name="is_id_card" widget="boolean_toggle" /> + <field name="recipient_file_fse" /> + <field + name="project_invoicing_status_id" + widget="many2many_tags" + options="{'no_create': True}" + domain="[('ur_id', '=', ur_id)]" + attrs="{'invisible':[('project_invoicing_status_nb', '=', 0)]}" + /> </group> <group string="Phase d'information"> - <field name="date_first_rdv" attrs="{'required':[('project_status','=', '1_information')]}"/> - <field name="is_first_rdv_infocoll" widget="boolean_toggle"/> - <field name="date_send_guide"/> - <field name="adhesion_comments"/> + <field + name="date_first_rdv" + attrs="{'required':[('project_status','=', '1_information')]}" + /> + <field + name="is_first_rdv_infocoll" + widget="boolean_toggle" + /> + <field name="date_send_guide" /> + <field name="adhesion_comments" /> </group> - <group string="Phase de pré-diagnostic" attrs="{'invisible':[('project_status','in',('1_information'))]}"> - <field name="feasibility_study" widget="boolean_toggle"/> - <field name="amount_feasibility_study" widget="monetary"/> - <field name="date_prediag"/> + <group + string="Phase de pré-diagnostic" + attrs="{'invisible':[('project_status','in',('1_information'))]}" + > + <field + name="feasibility_study" + widget="boolean_toggle" + /> + <field + name="amount_feasibility_study" + widget="monetary" + /> + <field name="date_prediag" /> </group> - <group string="Phase d'accompagnement projet" attrs="{'invisible':[('project_status','in',('1_information','2_pre-diagnostic'))]}"> - <field name="date_convention"/> - <field name="amount_convention" widget="monetary"/> + <group + string="Phase d'accompagnement projet" + attrs="{'invisible':[('project_status','in',('1_information','2_pre-diagnostic'))]}" + > + <field name="date_convention" /> + <field name="amount_convention" widget="monetary" /> </group> - <group string="Phase d'adhésion" attrs="{'invisible':[('project_status','in',('1_information','2_pre-diagnostic','3_accompagnement'))]}"> - <field name="lm_adhesion_id" invisible="1"/> - <field name="lm_adhesion_year"/> - <field name="file_full" widget="boolean_toggle"/> - <field name="date_transmission_cg"/> - <field name="date_bureau_validation"/> + <group + string="Phase d'adhésion" + attrs="{'invisible':[('project_status','in',('1_information','2_pre-diagnostic','3_accompagnement'))]}" + > + <field name="lm_adhesion_id" invisible="1" /> + <field name="lm_adhesion_year" /> + <field name="file_full" widget="boolean_toggle" /> + <field name="date_transmission_cg" /> + <field name="date_bureau_validation" /> </group> </group> </page> </page> <page name='scop_staff' position="after"> - <page name="adhesion_processus2" string="Processus d'Adhésion" attrs="{'invisible': ['|', ('is_cooperative', '!=', True), ('project_status','!=','6_suivi')]}"> - <field name="project_invoicing_status_nb" invisible="1"/> + <page + name="adhesion_processus2" + string="Processus d'Adhésion" + attrs="{'invisible': ['|', ('is_cooperative', '!=', True), ('project_status','!=','6_suivi')]}" + > + <field name="project_invoicing_status_nb" invisible="1" /> <group col="3"> <group string="Général"> - <field name="project_number"/> - <field name="percent_realisation" widget="priority"/> - <field name="date_realisation"/> - <field name="prescriber_canal_id" options="{'no_create': True, 'no_open': True}"/> - <field name="project_federation" options="{'no_create': True, 'no_open': True}"/> - <field name="creation_delegate_id" - attrs="{'required':[('project_status','in',('3_accompagnement','4_adhesion', '5_cg'))]}" options="{'no_create': True}" domain="[('ur_id', '=', ur_id)]"/> - <field name="staff_existing"/> - <field name="staff_planned"/> + <field name="project_number" /> + <field name="percent_realisation" widget="priority" /> + <field name="date_realisation" /> + <field + name="prescriber_canal_id" + options="{'no_create': True, 'no_open': True}" + /> + <field + name="project_federation" + options="{'no_create': True, 'no_open': True}" + /> + <field + name="creation_delegate_id" + attrs="{'required':[('project_status','in',('3_accompagnement','4_adhesion', '5_cg'))]}" + options="{'no_create': True}" + domain="[('ur_id', '=', ur_id)]" + /> + <field name="staff_existing" /> + <field name="staff_planned" /> </group> <group string="Dossier UE"> - <field name="file_fse_open" widget="boolean_toggle"/> - <field name="date_return_file"/> - <field name="fse_full" widget="boolean_toggle"/> - <field name="recipient_file_fse"/> - <field name="project_invoicing_status_id" widget="many2many_tags" options="{'no_create': True}" domain="[('ur_id', '=', ur_id)]" attrs="{'invisible':[('project_invoicing_status_nb', '=', 0)]}" /> + <field name="file_fse_open" widget="boolean_toggle" /> + <field name="date_return_file" /> + <field name="fse_full" widget="boolean_toggle" /> + <field name="recipient_file_fse" /> + <field + name="project_invoicing_status_id" + widget="many2many_tags" + options="{'no_create': True}" + domain="[('ur_id', '=', ur_id)]" + attrs="{'invisible':[('project_invoicing_status_nb', '=', 0)]}" + /> </group> <group string="Phase d'information"> - <field name="date_first_rdv"/> - <field name="is_first_rdv_infocoll" widget="boolean_toggle"/> - <field name="date_send_guide"/> - <field name="adhesion_comments"/> + <field name="date_first_rdv" /> + <field + name="is_first_rdv_infocoll" + widget="boolean_toggle" + /> + <field name="date_send_guide" /> + <field name="adhesion_comments" /> </group> - <group string="Phase de pré-diagnostic" attrs="{'invisible':[('project_status','in',('1_information'))]}"> - <field name="feasibility_study" widget="boolean_toggle"/> - <field name="amount_feasibility_study" widget="monetary"/> - <field name="date_prediag"/> + <group + string="Phase de pré-diagnostic" + attrs="{'invisible':[('project_status','in',('1_information'))]}" + > + <field + name="feasibility_study" + widget="boolean_toggle" + /> + <field + name="amount_feasibility_study" + widget="monetary" + /> + <field name="date_prediag" /> </group> - <group string="Phase d'accompagnement projet" attrs="{'invisible':[('project_status','in',('1_information','2_pre-diagnostic'))]}"> - <field name="date_convention"/> - <field name="amount_convention" widget="monetary"/> + <group + string="Phase d'accompagnement projet" + attrs="{'invisible':[('project_status','in',('1_information','2_pre-diagnostic'))]}" + > + <field name="date_convention" /> + <field name="amount_convention" widget="monetary" /> </group> - <group string="Phase d'adhésion" attrs="{'invisible':[('project_status','in',('1_information','2_pre-diagnostic','3_accompagnement'))]}"> - <field name="file_full" widget="boolean_toggle"/> - <field name="date_transmission_cg"/> - <field name="date_bureau_validation"/> + <group + string="Phase d'adhésion" + attrs="{'invisible':[('project_status','in',('1_information','2_pre-diagnostic','3_accompagnement'))]}" + > + <field name="file_full" widget="boolean_toggle" /> + <field name="date_transmission_cg" /> + <field name="date_bureau_validation" /> </group> </group> </page> </page> <xpath expr="//button[@name='scop_abandonne']" position="after"> - <button string="Suivi sans adhésion" type="object" name="scop_suivi_non_adhesion" attrs="{'invisible':[('project_status','in',('5_cg', '6_suivi', '7_abandonne'))]}"/> + <button + string="Suivi sans adhésion" + type="object" + name="scop_suivi_non_adhesion" + attrs="{'invisible':[('project_status','in',('5_cg', '6_suivi', '7_abandonne'))]}" + /> </xpath> </field> @@ -153,10 +274,10 @@ <record id="view_partner_prospect_adhesion_tree" model="ir.ui.view"> <field name="name">prospect.adhesion.tree</field> <field name="model">res.partner</field> - <field name="inherit_id" ref="cgscop_partner.view_partner_prospect_tree"/> + <field name="inherit_id" ref="cgscop_partner.view_partner_prospect_tree" /> <field name="arch" type="xml"> <field name="project_status" position="after"> - <field name="percent_realisation" widget="priority"/> + <field name="percent_realisation" widget="priority" /> </field> </field> </record> @@ -167,35 +288,44 @@ <field name="model">res.partner.prescriber.canal</field> <field name="arch" type="xml"> <tree string="Canaux de Prescription" editable="top"> - <field name="name"/> + <field name="name" /> </tree> </field> </record> - <record id="action_view_res_partner_prescriber_canal_tree" model="ir.actions.act_window"> + <record + id="action_view_res_partner_prescriber_canal_tree" + model="ir.actions.act_window" + > <field name="name">Canaux de Prescription</field> <field name="res_model">res.partner.prescriber.canal</field> <field name="view_mode">tree</field> <field name="help">Affiche et gère les Canaux de Prescription</field> </record> - <menuitem id="menu_res_partner_prescriber_canal" - parent="cgscop_partner.menu_scop" - action="action_view_res_partner_prescriber_canal_tree" - sequence="15"/> + <menuitem + id="menu_res_partner_prescriber_canal" + parent="cgscop_partner.menu_scop" + action="action_view_res_partner_prescriber_canal_tree" + sequence="15" + /> <record id="view_partner_add_fse_form" model="ir.ui.view"> <field name="name">partner.fse.form</field> <field name="model">res.partner</field> - <field name="inherit_id" ref="base.view_partner_form"/> + <field name="inherit_id" ref="base.view_partner_form" /> <field name="arch" type="xml"> <xpath expr='//notebook' position="inside"> - <page name="eu_file" string="Dossier UE" attrs="{'invisible': ['|', ('is_company', '=', True), ('type','!=','contact')]}"> + <page + name="eu_file" + string="Dossier UE" + attrs="{'invisible': ['|', ('is_company', '=', True), ('type','!=','contact')]}" + > <group> - <field name="file_fse_open" widget="boolean_toggle"/> - <field name="date_return_file"/> - <field name="fse_full" widget="boolean_toggle"/> - <field name="recipient_file_fse"/> + <field name="file_fse_open" widget="boolean_toggle" /> + <field name="date_return_file" /> + <field name="fse_full" widget="boolean_toggle" /> + <field name="recipient_file_fse" /> </group> </page> </xpath> diff --git a/views/res_partner_federation.xml b/views/res_partner_federation.xml deleted file mode 100644 index 8c454a2a687f8ec039401ba03abb7519afdb6d83..0000000000000000000000000000000000000000 --- a/views/res_partner_federation.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2019 Le Filament - License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> - -<odoo> - <data> - <record id="view_res_partner_federation_tree" model="ir.ui.view"> - <field name="name">res.partner.federation.tree</field> - <field name="model">res.partner.federation</field> - <field name="arch" type="xml"> - <tree string="Fédérations" editable="top"> - <field name="name"/> - </tree> - </field> - </record> - - <record id="action_view_res_partner_federation_tree" model="ir.actions.act_window"> - <field name="name">Fédérations</field> - <field name="res_model">res.partner.federation</field> - <field name="view_mode">tree</field> - <field name="help">Affiche et gère les Fédérations</field> - </record> - - <menuitem id="menu_res_partner_federation" - parent="cgscop_partner.menu_scop" - action="action_view_res_partner_federation_tree" - sequence="16"/> - - </data> -</odoo> \ No newline at end of file diff --git a/views/res_partner_project_invoicing_status.xml b/views/res_partner_project_invoicing_status.xml index ceac0e078b0ec51c06507831db75221bdfae8675..33662c4b174abf92c808da111a8b7d9524b613a3 100644 --- a/views/res_partner_project_invoicing_status.xml +++ b/views/res_partner_project_invoicing_status.xml @@ -1,19 +1,22 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> <odoo> <data> - + <!-- statut de facturation projet --> <record id="view_res_partner_project_invoicing_status_tree" model="ir.ui.view"> <field name="name">res.partner.project.invoicing.status.tree</field> <field name="model">res.partner.project.invoicing.status</field> <field name="arch" type="xml"> <tree string="Etat de la facturation projet" editable="top"> - <field name="name"/> + <field name="name" /> </tree> </field> </record> - <record id="action_view_res_partner_project_invoicing_status_tree" model="ir.actions.act_window"> + <record + id="action_view_res_partner_project_invoicing_status_tree" + model="ir.actions.act_window" + > <field name="name">Etat de la facturation projet</field> <field name="res_model">res.partner.project.invoicing.status</field> <field name="domain">[('ur_id', '=', ur_id)]</field> @@ -21,12 +24,14 @@ <field name="help">Affiche et gère les états de facturation projet</field> </record> - <menuitem id="menu_res_partner_project_invoicing_status" + <menuitem + id="menu_res_partner_project_invoicing_status" parent="cgscop_partner.menu_scop" action="action_view_res_partner_project_invoicing_status_tree" groups="cgscop_partner.group_cg_administrator" - sequence="17"/> + sequence="17" + /> + - </data> -</odoo> \ No newline at end of file +</odoo> diff --git a/views/scop_adhesion_file.xml b/views/scop_adhesion_file.xml index 813d11f6b6a77f3cf933156931b19ff6249b214a..b4562fa0a453985616566d5dff63008169b9eb59 100644 --- a/views/scop_adhesion_file.xml +++ b/views/scop_adhesion_file.xml @@ -1,7 +1,6 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <!-- Copyright 2021 Le Filament License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> - <odoo> <data> <!-- Questionnaire Type --> @@ -10,9 +9,9 @@ <field name="model">scop.adhesion.file</field> <field name="arch" type="xml"> <tree string="Document" editable="top"> - <field name="name"/> - <field name="coop_type_id"/> - <field name="is_compulsory"/> + <field name="name" /> + <field name="coop_type_id" /> + <field name="is_compulsory" /> </tree> </field> </record> @@ -25,9 +24,11 @@ </record> <!-- MENUS --> - <menuitem id="menu_scop_adhesion_file" + <menuitem + id="menu_scop_adhesion_file" parent="cgscop_partner.menu_scop_lists" action="action_scop_adhesion_file_tree" - sequence="100"/> + sequence="100" + /> </data> </odoo> diff --git a/wizard/scop_adhesion_year_wizard.py b/wizard/scop_adhesion_year_wizard.py index de14d04485b5fde83a9dc5c4a3111b24f1aa7f5e..b542d5a3a086970d806653cfd97f6afca48a9663 100644 --- a/wizard/scop_adhesion_year_wizard.py +++ b/wizard/scop_adhesion_year_wizard.py @@ -1,24 +1,28 @@ -# © 2021 Le Filament (<http://www.le-filament.com>) +# © 2022 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 class ScopAdhesionYearWizard(models.TransientModel): - _name = 'scop.adhesion.year.wizard' + _name = "scop.adhesion.year.wizard" _description = "Wizard: Changer l'année du dossier d'adhésion" lm_adhesion_id = fields.Many2one( - comodel_name='liste.ministere', - string='Lm_adhesion_id', - required=False) + comodel_name="scop.liste.ministere", string="Lm_adhesion_id", required=False + ) current_year = fields.Integer( - string='Année actuelle', - related='lm_adhesion_id.year') + string="Année actuelle", related="lm_adhesion_id.year" + ) choosen_year = fields.Selection( - [(year, str(year)) for year in - range(fields.Date.today().year - 3, fields.Date.today().year + 2)], - string='Année choisie') + [ + (str(year), str(year)) + for year in range( + fields.Date.today().year - 3, fields.Date.today().year + 2 + ) + ], + string="Année choisie", + ) # ------------------------------------------------------ # Actions / Buttons @@ -29,5 +33,5 @@ class ScopAdhesionYearWizard(models.TransientModel): :return: """ partner = self.lm_adhesion_id.partner_id - partner.lm_adhesion_id = partner.get_lm_adhesion(self.choosen_year) - return {'type': 'ir.actions.act_window_close'} + partner.lm_adhesion_id = partner.get_lm_adhesion(int(self.choosen_year)) + return {"type": "ir.actions.act_window_close"} diff --git a/wizard/scop_adhesion_year_wizard.xml b/wizard/scop_adhesion_year_wizard.xml index ce68a9accf7e010e369b763760b2497d251050ed..1405f19cadf2b1723c27c9ef11c896854ae158c7 100644 --- a/wizard/scop_adhesion_year_wizard.xml +++ b/wizard/scop_adhesion_year_wizard.xml @@ -1,7 +1,6 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <!-- Copyright 2021 Le Filament License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> - <odoo> <data> @@ -11,13 +10,17 @@ <field name="arch" type="xml"> <form string="Changer l'année du dossier d'adhésion"> <group> - <field name="current_year"/> - <field name="choosen_year" required="1"/> + <field name="current_year" /> + <field name="choosen_year" required="1" /> </group> <footer> - <button name="change_year" type="object" - string="Valider" class="oe_highlight"/> - <button special="cancel" string="Annuler"/> + <button + name="change_year" + type="object" + string="Valider" + class="oe_highlight" + /> + <button special="cancel" string="Annuler" /> </footer> </form> </field> diff --git a/wizard/scop_compulsory_fields_suivi_wizard.py b/wizard/scop_compulsory_fields_suivi_wizard.py index 90a731ed90bab0a20ff8666c3924ae0f11ccfbee..59e7e4c1348977d6ab273ef5f94ea0c349911975 100644 --- a/wizard/scop_compulsory_fields_suivi_wizard.py +++ b/wizard/scop_compulsory_fields_suivi_wizard.py @@ -5,28 +5,24 @@ from odoo import fields, models class ScopCompulsoryFieldsSuiviWizard(models.TransientModel): - _name = 'scop.compulsory.fields.suivi.wizard' - _description = "Wizard: Confirmer les champs obligatoires pour passage " \ - "en suivi " + _name = "scop.compulsory.fields.suivi.wizard" + _description = "Wizard: Confirmer les champs obligatoires pour passage en suivi " partner_id = fields.Many2one( - comodel_name='res.partner', - string='Coop', required=True) + comodel_name="res.partner", string="Coop", required=True + ) - ur_id = fields.Many2one( - related='partner_id.ur_id', readonly=False) + ur_id = fields.Many2one(related="partner_id.ur_id", readonly=False) creation_origin_id = fields.Many2one( - related='partner_id.creation_origin_id', readonly=False) - date_1st_sign = fields.Date( - related='partner_id.date_1st_sign', readonly=False) - social_object = fields.Text( - related='partner_id.social_object', readonly=False) - capital = fields.Integer( - related='partner_id.capital', readonly=False) - first_closeout = fields.Date( - related='partner_id.first_closeout', readonly=False) + related="partner_id.creation_origin_id", readonly=False + ) + date_1st_sign = fields.Date(related="partner_id.date_1st_sign", readonly=False) + social_object = fields.Text(related="partner_id.social_object", readonly=False) + capital = fields.Integer(related="partner_id.capital", readonly=False) + first_closeout = fields.Date(related="partner_id.first_closeout", readonly=False) closeout_month = fields.Selection( - related='partner_id.closeout_month', readonly=False) + related="partner_id.closeout_month", readonly=False + ) # ------------------------------------------------------ # Actions / Buttons @@ -35,7 +31,5 @@ class ScopCompulsoryFieldsSuiviWizard(models.TransientModel): """ Passe la coop en statut "6_suivi" """ - self.partner_id.write({ - 'project_status': '6_suivi' - }) - return {'type': 'ir.actions.act_window_close'} + self.partner_id.write({"project_status": "6_suivi"}) + return {"type": "ir.actions.act_window_close"} diff --git a/wizard/scop_compulsory_fields_suivi_wizard.xml b/wizard/scop_compulsory_fields_suivi_wizard.xml index c615b35bf5af084f44c3f770516a46b3e8902189..f2a3c47f19b86d81c0a7431e87b8c6d4197ea7b1 100644 --- a/wizard/scop_compulsory_fields_suivi_wizard.xml +++ b/wizard/scop_compulsory_fields_suivi_wizard.xml @@ -1,32 +1,46 @@ -<?xml version="1.0"?> +<?xml version="1.0" ?> <!-- Copyright 2021 Le Filament License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> - <odoo> <data> - <record model="ir.ui.view" id="scop_adhesion_compulsory_fields_suivi_wizard_form"> + <record + model="ir.ui.view" + id="scop_adhesion_compulsory_fields_suivi_wizard_form" + > <field name="name">scop.adhesion.compulsory.fields.suivi.wizard.form</field> <field name="model">scop.compulsory.fields.suivi.wizard</field> <field name="arch" type="xml"> <form string="Confirmer les champs obligatoires"> <group> - <field name="ur_id" required="1" options="{'no_create': True, 'no_edit': True}"/> - <field name="creation_origin_id" required="1" options="{'no_create': True, 'no_edit': True}"/> - <field name="date_1st_sign" required="1"/> - <field name="social_object" required="1"/> - <field name="capital" required="1"/> - <field name="first_closeout" required="1"/> - <field name="closeout_month" required="1"/> + <field + name="ur_id" + required="1" + options="{'no_create': True, 'no_edit': True}" + /> + <field + name="creation_origin_id" + required="1" + options="{'no_create': True, 'no_edit': True}" + /> + <field name="date_1st_sign" required="1" /> + <field name="social_object" required="1" /> + <field name="capital" required="1" /> + <field name="first_closeout" required="1" /> + <field name="closeout_month" required="1" /> </group> <footer> - <button name="confirm" type="object" - string="Valider" class="oe_highlight"/> - <button special="cancel" string="Annuler"/> + <button + name="confirm" + type="object" + string="Valider" + class="oe_highlight" + /> + <button special="cancel" string="Annuler" /> </footer> </form> </field> </record> </data> -</odoo> \ No newline at end of file +</odoo>