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..9429bc688aab4993eae460767368f65089afa323 --- /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: 2019 + +overrides: + - files: + - "**/*.esm.js" + parserOptions: + sourceType: module + +# Globals available in Odoo that shouldn't produce errorings +globals: + _: readonly + $: readonly + fuzzy: readonly + jQuery: readonly + moment: readonly + odoo: readonly + openerp: readonly + owl: readonly + +# 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 index 75bb2042901930f807a588241612a29dd75e34d5..9c283fd41f6cc3330653f1d90a820b85e23caf65 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,74 @@ -.* -*.pyc -!.gitignore +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +/.venv +/.pytest_cache + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +bin/ +build/ +develop-eggs/ +dist/ +eggs/ +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..168470e2ed745631aefb772a4a864cf1de76d3cb --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,123 @@ +exclude: | + (?x) + # NOT INSTALLABLE ADDONS + # END NOT INSTALLABLE ADDONS + # Files and folders generated by bots, to avoid loops + ^setup/|/static/description/index\.html$| + # We don't want to mess with tool-generated files + .svg$|/tests/([^/]+/)?cassettes/|^.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.18.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: dfba427ba03900b69e0a7f2c65890dc48921d36a + 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: 22.3.0 + hooks: + - id: black + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.4.1 + hooks: + - id: prettier + name: prettier (with plugin-xml) + additional_dependencies: + - "prettier@2.4.1" + - "@prettier/plugin-xml@1.1.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.32.0 + hooks: + - id: eslint + verbose: true + args: + - --color + - --fix + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + 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.29.0 + hooks: + - id: pyupgrade + args: ["--keep-percent-format"] + - repo: https://github.com/PyCQA/isort + rev: 5.9.3 + hooks: + - id: isort + name: isort except __init__.py + args: + - --settings=. + exclude: /__init__\.py$ + - repo: https://gitlab.com/PyCQA/flake8 + rev: 3.9.2 + hooks: + - id: flake8 + name: flake8 + additional_dependencies: ["flake8-bugbear==21.9.2"] + - repo: https://github.com/OCA/pylint-odoo + rev: 7.0.2 + hooks: + - id: pylint_odoo + name: pylint with optional checks + args: + - --rcfile=.pylintrc + - --exit-zero + verbose: true + - id: pylint_odoo + args: + - --rcfile=.pylintrc-mandatory 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..d431ca78d44080ba32c20c6991c2655f2ab6423b --- /dev/null +++ b/.pylintrc @@ -0,0 +1,120 @@ +[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=15.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, + attribute-string-redundant, + character-not-valid-in-resource-link, + consider-merging-classes-inherited, + context-overridden, + create-user-wo-reset-password, + dangerous-filter-wo-user, + dangerous-qweb-replace-wo-priority, + deprecated-data-xml-node, + deprecated-openerp-xml-node, + duplicate-po-message-definition, + except-pass, + file-not-used, + invalid-commit, + manifest-maintainers-list, + missing-newline-extrafiles, + missing-readme, + missing-return, + odoo-addons-relative-import, + old-api7-method-defined, + po-msgstr-variables, + po-syntax-error, + renamed-field-parameter, + resource-not-exist, + str-format-used, + test-folder-imported, + translation-contains-variable, + translation-positional-used, + unnecessary-utf8-coding-comment, + website-manifest-key-not-valid-uri, + xml-attribute-translatable, + xml-deprecated-qweb-directive, + xml-deprecated-tree-attribute, + # messages that do not cause the lint step to fail + consider-merging-classes-inherited, + create-user-wo-reset-password, + dangerous-filter-wo-user, + deprecated-module, + file-not-used, + invalid-commit, + missing-manifest-dependency, + missing-newline-extrafiles, + missing-readme, + no-utf8-coding-comment, + odoo-addons-relative-import, + old-api7-method-defined, + redefined-builtin, + too-complex, + unnecessary-utf8-coding-comment + + +[REPORTS] +msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} +output-format=colorized +reports=no diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory new file mode 100644 index 0000000000000000000000000000000000000000..189c548631665bef116fc4d0df3b986f9727df31 --- /dev/null +++ b/.pylintrc-mandatory @@ -0,0 +1,96 @@ +[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=15.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, + attribute-string-redundant, + character-not-valid-in-resource-link, + consider-merging-classes-inherited, + context-overridden, + create-user-wo-reset-password, + dangerous-filter-wo-user, + dangerous-qweb-replace-wo-priority, + deprecated-data-xml-node, + deprecated-openerp-xml-node, + duplicate-po-message-definition, + except-pass, + file-not-used, + invalid-commit, + manifest-maintainers-list, + missing-newline-extrafiles, + missing-readme, + missing-return, + odoo-addons-relative-import, + old-api7-method-defined, + po-msgstr-variables, + po-syntax-error, + renamed-field-parameter, + resource-not-exist, + str-format-used, + test-folder-imported, + translation-contains-variable, + translation-positional-used, + unnecessary-utf8-coding-comment, + website-manifest-key-not-valid-uri, + xml-attribute-translatable, + xml-deprecated-qweb-directive, + xml-deprecated-tree-attribute + +[REPORTS] +msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} +output-format=colorized +reports=no diff --git a/README.rst b/README.rst index 694cd277acf05b0e2f17892de49df5d1d0ed63de..1a0e33efe5c3060ae06fbd22f87e2c4486c81c4d 100644 --- a/README.rst +++ b/README.rst @@ -17,7 +17,7 @@ Gestion de la formation INTRA pour Le Filament. Ce module ajoute un menu supplé * **Programmes** : pour la gestion du catalogie de formations proposées * **Modules** : pour la gestion des modules proposés dans chaque formation -Ce module permet églement pour chaque formation d'imprimer les différents documents administratifs : +Ce module permet églement pour chaque formation d'imprimer les différents documents administratifs : * Programme * Convention @@ -77,4 +77,4 @@ Maintainer :alt: Le Filament :target: https://le-filament.com -This module is maintained by Le Filament \ No newline at end of file +This module is maintained by Le Filament diff --git a/__init__.py b/__init__.py index ec09c5bbfe1ca2c13882cc1b596a498576e71d6e..0650744f6bc69b9f0b865e8c7174c813a5f5995e 100644 --- a/__init__.py +++ b/__init__.py @@ -1,5 +1 @@ -# -*- coding: utf-8 -*- -# © 2019 Le Filament (<http://www.le-filament.com>) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - from . import models diff --git a/__manifest__.py b/__manifest__.py index 2190e2c356074dce219c93bdee72d11daf9cfa81..cfe161219722a6eb2af6efa171bc39649fdb3b35 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -1,32 +1,36 @@ -# -*- coding: utf-8 -*- - -{ - 'name': 'Le Filament - Training', - 'version': '14.0.1.0.0', - 'summary': 'Training sessions managment', - 'license': 'AGPL-3', - 'author': 'LE FILAMENT', - 'category': 'LE FILAMENT', - 'depends': ['base', 'account', 'sale', 'partner_firstname'], - 'contributors': [ - 'Benjamin Rivier <benjamin@le-filament.com>', - ], - 'website': 'http://www.le-filament.com', - 'data': [ - 'data/ir_module_category.xml', - 'security/training_security.xml', - 'security/ir.model.access.csv', - 'data/training_data.xml', - 'views/account_move_view.xml', - 'views/assets.xml', - 'views/partner_view.xml', - 'views/sale_order_view.xml', - 'views/training_course_view.xml', - 'views/training_training_view.xml', - 'views/training_session_view.xml', - 'report/report_agreement.xml', - 'report/report_attestation.xml', - 'report/report_attendance_sheet.xml', - 'report/report_program.xml', - ], -} +{ + "name": "Le Filament - Training", + "version": "15.0.1.0.0", + "summary": "Training sessions managment", + "license": "AGPL-3", + "author": "Le Filament", + "depends": ["base", "account", "sale", "partner_firstname"], + "contributors": [ + "Benjamin Rivier <benjamin@le-filament.com>", + ], + "website": "https://le-filament.com", + "data": [ + "data/ir_module_category.xml", + "security/training_security.xml", + "security/ir.model.access.csv", + "data/training_data.xml", + "views/account_move_view.xml", + "views/partner_view.xml", + "views/sale_order_view.xml", + "views/training_course_view.xml", + "views/training_training_view.xml", + "views/training_session_view.xml", + "report/report_agreement.xml", + "report/report_attestation.xml", + "report/report_attendance_sheet.xml", + "report/report_program.xml", + ], + "assets": { + "web.assets_common": [ + "lefilament_training/static/src/scss/style.scss", + ], + "web.report_assets_pdf": [ + "lefilament_training/static/src/scss/style.scss", + ], + }, +} diff --git a/data/ir_module_category.xml b/data/ir_module_category.xml index 853092def4b79b0058b6bbf789d72d8e0296d421..1c4fc947bc00e44dc207c1cde72685531fa1c8da 100644 --- a/data/ir_module_category.xml +++ b/data/ir_module_category.xml @@ -1,12 +1,10 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2019 Le Filament (<https://www.le-filament.com>) +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2019-2022 Le Filament (<https://le-filament.com>) License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <data> - <record model="ir.module.category" id="module_category_training"> - <field name="name">Formation</field> - <field name="description">Gestionnaire de formation</field> - <field name="sequence">230</field> - </record> - </data> + <record model="ir.module.category" id="module_category_training"> + <field name="name">Formation</field> + <field name="description">Gestionnaire de formation</field> + <field name="sequence">230</field> + </record> </odoo> diff --git a/data/training_data.xml b/data/training_data.xml index ce092d562a510d4eaa69ab754ec997fadf717add..a3ebeb0587feef8228325bc8b281f33b1f3654fe 100644 --- a/data/training_data.xml +++ b/data/training_data.xml @@ -1,16 +1,16 @@ -<?xml version="1.0" encoding="utf-8"?> -<odoo> - <data noupdate="1"> - <!-- Training sequences --> - <record id="sequence_payment_customer_invoice" model="ir.sequence"> - <field name="name">Training Agreement sequence</field> - <field name="code">training.training</field> - <field name="prefix">%(range_year)s</field> - <field eval="1" name="number_next"/> - <field eval="1" name="number_increment"/> - <field eval="False" name="use_date_range"/> - <field eval="False" name="company_id"/> - <field name="padding">3</field> - </record> - </data> -</odoo> \ No newline at end of file +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2019-2022 Le Filament (<https://le-filament.com>) + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> +<odoo noupdate="1"> + <!-- Training sequences --> + <record id="sequence_payment_customer_invoice" model="ir.sequence"> + <field name="name">Training Agreement sequence</field> + <field name="code">training.training</field> + <field name="prefix">%(range_year)s</field> + <field eval="1" name="number_next" /> + <field eval="1" name="number_increment" /> + <field eval="False" name="use_date_range" /> + <field eval="False" name="company_id" /> + <field name="padding">3</field> + </record> +</odoo> diff --git a/models/__init__.py b/models/__init__.py index 6a8b0891b4e5d8b2be95e3ca78ea47e231a5ff7f..9af0c3dbaad804f5306896ad797d04c7410561ec 100644 --- a/models/__init__.py +++ b/models/__init__.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- -# © 2019 Le Filament (<http://www.le-filament.com>) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - from . import account_move from . import partner from . import sale_order diff --git a/models/account_move.py b/models/account_move.py index a31462324f3b488f45cb928687a25dff2f71cff4..89b747739a3d51644b53471ab0016b8bfd25d7ca 100644 --- a/models/account_move.py +++ b/models/account_move.py @@ -1,13 +1,10 @@ -# -*- coding: utf-8 -*- -# © 2019 Le Filament (<http://www.le-filament.com>) +# Copyright 2019-2022 Le Filament (<https://le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields +from odoo import fields, models class AccountInvoiceTraining(models.Model): - _inherit = ['account.move'] + _inherit = ["account.move"] - training_id = fields.Many2one( - comodel_name='training.training', - string='Formation') + training_id = fields.Many2one(comodel_name="training.training", string="Formation") diff --git a/models/partner.py b/models/partner.py index 085e9d6579b20fda6493195211432d78e18f4bdf..5f7263c43613e6adffa1f9063b8af290f188af8c 100644 --- a/models/partner.py +++ b/models/partner.py @@ -1,11 +1,10 @@ -# -*- coding: utf-8 -*- -# © 2019 Le Filament (<http://www.le-filament.com>) +# Copyright 2019-2022 Le Filament (<https://le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields +from odoo import fields, models class PartnerTraining(models.Model): - _inherit = ['res.partner'] + _inherit = ["res.partner"] - is_opco = fields.Boolean('OPCO') + is_opco = fields.Boolean("OPCO") diff --git a/models/sale_order.py b/models/sale_order.py index 7525dfb200de285f7236eadab40ebc83e82b8565..56bf4e36f291287da6b4f2ce258d69ebb34b80bc 100644 --- a/models/sale_order.py +++ b/models/sale_order.py @@ -1,13 +1,10 @@ -# -*- coding: utf-8 -*- -# © 2019 Le Filament (<http://www.le-filament.com>) +# Copyright 2019-2022 Le Filament (<https://le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields +from odoo import fields, models class SaleOrderTraining(models.Model): - _inherit = 'sale.order' + _inherit = "sale.order" - training_id = fields.Many2one( - comodel_name='training.training', - string='Formation') + training_id = fields.Many2one(comodel_name="training.training", string="Formation") diff --git a/models/training_course.py b/models/training_course.py index 6b3b26749eb1bcd768281223c666d23659897eb6..a04890b220498d5ef4df993ea555a414e73dd757 100644 --- a/models/training_course.py +++ b/models/training_course.py @@ -1,62 +1,65 @@ -# -*- coding: utf-8 -*- -# © 2019 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 - - -class TrainingProgram(models.Model): - _name = 'training.course' - _description = 'Training courses' - _inherit = 'mail.thread' - - name = fields.Char(string='Nom', required=True,) - description = fields.Text(string='Description') - objective = fields.Text(string='Objectif') - method = fields.Text(string='Méthodologie') - means = fields.Text(string='Moyens Pédagogiques') - control = fields.Text(string='Suivi') - evaluation = fields.Text(string='Modalités évaluation') - nature = fields.Text(string="Nature de l'action") - acquis = fields.Text(string="Acquis de la formation") - students_profile = fields.Text(string='Profil des stagiaires') - session_ids = fields.Many2many( - comodel_name='training.course.session', - relation='program_course_rel', - column1='program_id', - column2='course_id', - string='Sessions',) - duration_total = fields.Integer( - string='Durée totale', - compute='_compute_sessions', - default=0, - store=True) - session_count = fields.Integer( - string="Nb Sessions", - compute='_compute_sessions', - default=0, - store=True) - - # ------------------------------------------------------ - # Compute - # ------------------------------------------------------ - @api.depends('session_ids') - def _compute_sessions(self): - self.session_count = len(self.session_ids) - self.duration_total = sum(self.session_ids.mapped('duration')) - - -class TrainingProgramSession(models.Model): - _name = 'training.course.session' - _description = 'Training course sessions' - - name = fields.Char(string='Nom', required=True,) - description = fields.Text(string='Description') - course_id = fields.Many2many( - comodel_name='training.course', - relation='program_course_rel', - column1='course_id', - column2='program_id', - string='Programmes',) - duration = fields.Integer(string='Durée (h)', default=4) - sequence = fields.Integer(string='Séquence', default=10) +# Copyright 2019-2022 Le Filament (<https://le-filament.com>) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + + +class TrainingProgram(models.Model): + _name = "training.course" + _description = "Training courses" + _inherit = "mail.thread" + + name = fields.Char( + string="Nom", + required=True, + ) + description = fields.Text() + objective = fields.Text(string="Objectif") + method = fields.Text(string="Méthodologie") + means = fields.Text(string="Moyens Pédagogiques") + control = fields.Text(string="Suivi") + evaluation = fields.Text(string="Modalités évaluation") + nature = fields.Text(string="Nature de l'action") + acquis = fields.Text(string="Acquis de la formation") + students_profile = fields.Text(string="Profil des stagiaires") + session_ids = fields.Many2many( + comodel_name="training.course.session", + relation="program_course_rel", + column1="program_id", + column2="course_id", + string="Sessions", + ) + duration_total = fields.Integer( + string="Durée totale", compute="_compute_sessions", default=0, store=True + ) + session_count = fields.Integer( + string="Nb Sessions", compute="_compute_sessions", default=0, store=True + ) + + # ------------------------------------------------------ + # Compute + # ------------------------------------------------------ + @api.depends("session_ids") + def _compute_sessions(self): + self.session_count = len(self.session_ids) + self.duration_total = sum(self.session_ids.mapped("duration")) + + +class TrainingProgramSession(models.Model): + _name = "training.course.session" + _description = "Training course sessions" + + name = fields.Char( + string="Nom", + required=True, + ) + description = fields.Text() + course_id = fields.Many2many( + comodel_name="training.course", + relation="program_course_rel", + column1="course_id", + column2="program_id", + string="Programmes", + ) + duration = fields.Integer(string="Durée (h)", default=4) + sequence = fields.Integer(string="Séquence", default=10) diff --git a/models/training_session.py b/models/training_session.py index 8b91594aeeaf8ac6c3d99dbe909d075c662ed7f4..131c7d997b1658a98ae1965012bc3fd65ab9adbf 100644 --- a/models/training_session.py +++ b/models/training_session.py @@ -1,33 +1,31 @@ -# -*- coding: utf-8 -*- -# © 2019 Le Filament (<http://www.le-filament.com>) +# Copyright 2019-2022 Le Filament (<https://le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields +from odoo import fields, models class TrainingSession(models.Model): - _name = 'training.session' - _description = 'Training sessions' + _name = "training.session" + _description = "Training sessions" _order = "sequence,id" - _rec_name = 'session_id' + _rec_name = "session_id" session_id = fields.Many2one( - comodel_name='training.course.session', - string='Session', - required=True) + comodel_name="training.course.session", string="Session", required=True + ) training_id = fields.Many2one( - comodel_name='training.training', - string='Formation', - ondelete='cascade', - required=True) + comodel_name="training.training", + string="Formation", + ondelete="cascade", + required=True, + ) customer_id = fields.Many2one( - comodel_name='res.partner', - string='Client', - related='training_id.customer_id', - store=True) - date = fields.Datetime('Date',) - user_id = fields.Many2one( - comodel_name='res.users', - string='Formateur') - date_delay = fields.Integer(string='Durée (h)') - sequence = fields.Integer(string='Séquence', default=10) + comodel_name="res.partner", + string="Client", + related="training_id.customer_id", + store=True, + ) + date = fields.Datetime() + user_id = fields.Many2one(comodel_name="res.users", string="Formateur") + date_delay = fields.Integer(string="Durée (h)") + sequence = fields.Integer(string="Séquence", default=10) diff --git a/models/training_student.py b/models/training_student.py index 20314b03f4c2d1c10e6134bee4ba504adacf4e17..d6781b5eb4a0e7e586c4fc1da80928fccf1e7a7c 100644 --- a/models/training_student.py +++ b/models/training_student.py @@ -1,41 +1,45 @@ -# -*- coding: utf-8 -*- -# © 2019 Le Filament (<http://www.le-filament.com>) +# Copyright 2019-2022 Le Filament (<https://le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields, api +from odoo import api, fields, models class TrainingStudent(models.Model): - _name = 'training.student' - _description = 'Training Students' + _name = "training.student" + _description = "Training Students" student_id = fields.Many2one( - comodel_name='res.partner', - string='Stagiaire', + comodel_name="res.partner", + string="Stagiaire", required=True, - domain=[('is_company', '=', False)]) + domain=[("is_company", "=", False)], + ) parent_id = fields.Many2one( - comodel_name='res.partner', - string='Entreprise', - domain=[('is_company', '=', True)]) - training_id = fields.Many2one( - comodel_name='training.training', - string='Formation') + comodel_name="res.partner", + string="Entreprise", + domain=[("is_company", "=", True)], + ) + training_id = fields.Many2one(comodel_name="training.training", string="Formation") certificate = fields.Binary(string="Attestation") - _sql_constraints = [ ( - 'course_unique','UNIQUE(student_id, training_id)', - "Un stagiaire ne peut être inscrit qu'une fois") ] + _sql_constraints = [ + ( + "course_unique", + "UNIQUE(student_id, training_id)", + "Un stagiaire ne peut être inscrit qu'une fois", + ) + ] # ------------------------------------------------------ # Onchange # ------------------------------------------------------ - @api.onchange('parent_id') + @api.onchange("parent_id") def _onchange_student_id(self): vals = {} - vals['domain'] = { - 'student_id': [ - ('is_company', '=', False), - ('parent_id', '=', self.parent_id.id)], + vals["domain"] = { + "student_id": [ + ("is_company", "=", False), + ("parent_id", "=", self.parent_id.id), + ], } return vals diff --git a/models/training_training.py b/models/training_training.py index 1667878e9d3b8a52061c324502c190b9bc64ab0c..ed742afdf310a5bf38803afb8154d1ae5dd41913 100644 --- a/models/training_training.py +++ b/models/training_training.py @@ -1,112 +1,105 @@ -# -*- coding: utf-8 -*- -# © 2019 Le Filament (<http://www.le-filament.com>) +# Copyright 2019-2022 Le Filament (<https://le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields, api +from odoo import api, fields, models class Training(models.Model): - _name = 'training.training' - _inherit = 'mail.thread' - _rec_name = 'course_id' - _order = 'date_begin desc' - _description = 'Training for customers' + _name = "training.training" + _inherit = "mail.thread" + _rec_name = "course_id" + _order = "date_begin desc" + _description = "Training for customers" customer_id = fields.Many2one( - comodel_name='res.partner', - string='Client', - domain=[('is_company', '=', True)]) + comodel_name="res.partner", string="Client", domain=[("is_company", "=", True)] + ) opco_id = fields.Many2one( - comodel_name='res.partner', - string='OPCO', - domain=[('is_company', '=', True), ('is_opco', '=', True)]) + comodel_name="res.partner", + string="OPCO", + domain=[("is_company", "=", True), ("is_opco", "=", True)], + ) student_ids = fields.One2many( - comodel_name='training.student', - inverse_name='training_id', - string='Stagiaires',) + comodel_name="training.student", + inverse_name="training_id", + string="Stagiaires", + ) session_ids = fields.One2many( - comodel_name='training.session', - inverse_name='training_id', - string='Sessions',) - course_id = fields.Many2one( - comodel_name='training.course', - string='Programme') + comodel_name="training.session", + inverse_name="training_id", + string="Sessions", + ) + course_id = fields.Many2one(comodel_name="training.course", string="Programme") type = fields.Selection( - string='Type', - required=True, - selection=[('intra', 'INTRA'), ('inter', 'INTER')]) + required=True, selection=[("intra", "INTRA"), ("inter", "INTER")] + ) agreement_number = fields.Char( - string='Numéro Convention', + string="Numéro Convention", required=True, copy=False, readonly=True, - states={'draft': [('readonly', False)]}, + states={"draft": [("readonly", False)]}, index=True, - default='Brouillon') + default="Brouillon", + ) payment = fields.Boolean(string="Subrogation de paiement") - date_begin = fields.Date(string='Début de la formation') - date_end = fields.Date(string='Fin de la formation') - session_hours = fields.Char(string='Horaires') + date_begin = fields.Date(string="Début de la formation") + date_end = fields.Date(string="Fin de la formation") + session_hours = fields.Char(string="Horaires") students_nb_prev = fields.Char(string="Nb Stagiaires Prévisionnel") - convention = fields.Binary(string="Convention") - date_convention = fields.Date(string="Date Convention") - date_attestation = fields.Date(string="Date Attestation") - hours = fields.Integer( - string='Durée (h)', - compute='_compute_sessions', - store=True) + convention = fields.Binary() + date_convention = fields.Date() + date_attestation = fields.Date() + hours = fields.Integer(string="Durée (h)", compute="_compute_sessions", store=True) hours_total = fields.Integer( - string="Nombre d'heures", - compute='_compute_hours_total', - store=True) + string="Nombre d'heures", compute="_compute_hours_total", store=True + ) session_count = fields.Integer( - string="Nbre Sessions", - compute='_compute_sessions', - default=0, - store=True) - rate = fields.Integer( - string="Taux horaire", - compute='_compute_costs', - default=0) + string="Nbre Sessions", compute="_compute_sessions", default=0, store=True + ) + rate = fields.Integer(string="Taux horaire", compute="_compute_costs", default=0) students_count = fields.Integer( - string='Nombre de stagiaires', - compute='_compute_students_count', - store=True,) - cost = fields.Float(string='Prix de vente') - student_cost = fields.Float(string='Prix / Stagiaire') + string="Nombre de stagiaires", + compute="_compute_students_count", + store=True, + ) + cost = fields.Float(string="Prix de vente") + student_cost = fields.Float(string="Prix / Stagiaire") amount = fields.Float( - string='Commandé', - compute='_compute_amount', - store=True,) + string="Commandé", + compute="_compute_amount", + store=True, + ) invoiced = fields.Float( - string='Facturé', - compute='_compute_invoiced', - store=True,) + string="Facturé", + compute="_compute_invoiced", + store=True, + ) order_ids = fields.One2many( - comodel_name='sale.order', - inverse_name='training_id', - string='Commandes',) + comodel_name="sale.order", + inverse_name="training_id", + string="Commandes", + ) invoice_ids = fields.One2many( - comodel_name='account.move', - inverse_name='training_id', - string='Factures',) + comodel_name="account.move", + inverse_name="training_id", + string="Factures", + ) state = fields.Selection( - string='State', - selection=[ - ('draft', 'Brouillon'), - ('current', 'Accepté'), - ('done', 'Réalisé')], - default='draft') - place = fields.Text(string='Lieu de la formation') + selection=[("draft", "Brouillon"), ("current", "Accepté"), ("done", "Réalisé")], + default="draft", + ) + place = fields.Text(string="Lieu de la formation") company_id = fields.Many2one( - comodel_name='res.company', - string='Company', + comodel_name="res.company", + string="Company", change_default=True, required=True, readonly=True, - default=lambda self: self.env['res.company']._company_default_get()) - file_number = fields.Char(string='N° Dossier') - plan = fields.Char(string='Dispositif') + default=lambda self: self.env["res.company"]._company_default_get(), + ) + file_number = fields.Char(string="N° Dossier") + plan = fields.Char(string="Dispositif") # ------------------------------------------------------ # Override ORM @@ -114,38 +107,42 @@ class Training(models.Model): @api.model def create(self, vals): record = super(Training, self).create(vals) - if vals.get('course_id', False): + if vals.get("course_id", False): for s in record.course_id.session_ids: - self.env['training.session'].create({ - 'session_id': s.id, - 'training_id': record.id, - 'date_delay': s.duration, - 'sequence': s.sequence, - }) + self.env["training.session"].create( + { + "session_id": s.id, + "training_id": record.id, + "date_delay": s.duration, + "sequence": s.sequence, + } + ) return record def write(self, vals): record = super(Training, self).write(vals) - if vals.get('course_id', False): + if vals.get("course_id", False): self.session_ids.unlink() for s in self.course_id.session_ids: - self.env['training.session'].create({ - 'session_id': s.id, - 'training_id': self.id, - 'date_delay': s.duration, - 'sequence': s.sequence, - }) + self.env["training.session"].create( + { + "session_id": s.id, + "training_id": self.id, + "date_delay": s.duration, + "sequence": s.sequence, + } + ) return record # ------------------------------------------------------ # compute # ------------------------------------------------------ - @api.depends('student_ids') + @api.depends("student_ids") def _compute_students_count(self): for record in self: record.students_count = len(record.student_ids) - @api.depends('students_count', 'cost', 'hours_total') + @api.depends("students_count", "cost", "hours_total") def _compute_costs(self): for record in self: record.student_cost = 0 @@ -155,43 +152,45 @@ class Training(models.Model): if record.hours_total > 0: record.rate = record.cost / record.hours_total - @api.depends('session_ids') + @api.depends("session_ids") def _compute_sessions(self): for record in self: record.session_count = len(record.session_ids) - record.hours = sum(record.session_ids.mapped('date_delay')) + record.hours = sum(record.session_ids.mapped("date_delay")) - @api.depends('students_count', 'hours') + @api.depends("students_count", "hours") def _compute_hours_total(self): for record in self: record.hours_total = record.students_count * record.hours - @api.depends('order_ids') + @api.depends("order_ids") def _compute_amount(self): - self.amount = sum(self.order_ids.mapped('amount_untaxed')) + self.amount = sum(self.order_ids.mapped("amount_untaxed")) - @api.depends('invoice_ids') + @api.depends("invoice_ids") def _compute_invoiced(self): for record in self: - record.invoiced = sum(record.invoice_ids.mapped('amount_untaxed_signed')) + record.invoiced = sum(record.invoice_ids.mapped("amount_untaxed_signed")) # ------------------------------------------------------ # Buttons # ------------------------------------------------------ def action_valid(self): for training in self: - training.state = 'current' - training.agreement_number = self.env['ir.sequence'].next_by_code('training.training') + training.state = "current" + training.agreement_number = self.env["ir.sequence"].next_by_code( + "training.training" + ) def action_done(self): for training in self: - training.state = 'done' + training.state = "done" def action_draft(self): for training in self: - training.state = 'draft' + training.state = "draft" def _get_trainers(self): for training in self: - trainers = training.session_ids.mapped('user_id') + trainers = training.session_ids.mapped("user_id") return trainers diff --git a/report/report_agreement.xml b/report/report_agreement.xml index eb091ef3b7a619f73142b23f1e5ddafa1679f4e1..f045dca52e26dba7dcabc756699468ce6aeb374c 100644 --- a/report/report_agreement.xml +++ b/report/report_agreement.xml @@ -1,164 +1,228 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2019-2022 Le Filament (<https://le-filament.com>) + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <data> + <template id="qweb_agreement_pdf"> + <t t-call="web.html_container"> + <t t-foreach="docs" t-as="doc"> + <t t-call="web.external_layout"> + <div class="page"> + <div class="convention"> + <div class="col-12 text-center"> + <h1>CONVENTION DE FORMATION PROFESSIONNELLE N°<span + t-field="doc.agreement_number" + /></h1> + <h2><span t-field="doc.course_id.name" /></h2> + <hr /> + </div> + <div class="col-12"> + <p>ENTRE :</p> + <p> + <strong + >LE FILAMENT</strong> – Déclaration d’activité enregistrée sous le numéro 73310810731 auprès de la Préfecture de la région Occitanie – dont le siège est situé 32 Rue Riquet – 31000 TOULOUSE. + Représenté par Monsieur Benjamin RIVIER, Gérant + </p> + <p>ET</p> + <p> + <strong><span + t-field="doc.customer_id.name" + /></strong> - <span + t-field="doc.customer_id.street" + /> - <span t-field="doc.customer_id.zip" /> <span + t-field="doc.customer_id.city" + />. + </p> + <p + >Il est établi la présente convention de formation en application des dispositions de la sixième partie du Code du Travail (article L6353-1 à 2 et R6353-1) portant organisation de la formation professionnelle continue tout au long de la vie.</p> - <template id="qweb_agreement_pdf"> - <t t-call="web.html_container"> - <t t-foreach="docs" t-as="doc"> - <t t-call="web.external_layout"> - <div class="page"> - <div class="convention"> - <div class="col-12 text-center"> - <h1>CONVENTION DE FORMATION PROFESSIONNELLE N°<span t-field="doc.agreement_number" /></h1> - <h2><span t-field="doc.course_id.name" /></h2> - <hr/> - </div> - <div class="col-12"> - <p>ENTRE :</p> - <p> - <strong>LE FILAMENT</strong> – Déclaration d’activité enregistrée sous le numéro 73310810731 auprès de la Préfecture de la région Occitanie – dont le siège est situé 32 Rue Riquet – 31000 TOULOUSE. - Représenté par Monsieur Benjamin RIVIER, Gérant - </p> - <p>ET</p> + <div class="subblock"> + <h3 + >ARTICLE 1 - OBJET ET CARACTERISTIQUES DE LA FORMATION</h3> + <p + >En exécution de la présente convention, l’organisme LE FILAMENT s’engage à organiser l’action de formation intitulée : <span + t-field="doc.course_id.name" + /></p> + <p + >L’objet, le programme, les méthodes pédagogiques, l’évaluation de cette formation relèvent de l’acquisition, de l’entretien ou du perfectionnement des connaissances (article L6313-1 du Code du Travail).</p> <p> - <strong><span t-field="doc.customer_id.name" /></strong> - <span t-field="doc.customer_id.street" /> - <span t-field="doc.customer_id.zip" /> <span t-field="doc.customer_id.city" />. + Objectif de formation : <br /> + <span t-field="doc.course_id.objective" /> </p> - <p>Il est établi la présente convention de formation en application des dispositions de la sixième partie du Code du Travail (article L6353-1 à 2 et R6353-1) portant organisation de la formation professionnelle continue tout au long de la vie.</p> - - <div class="subblock"> - <h3>ARTICLE 1 - OBJET ET CARACTERISTIQUES DE LA FORMATION</h3> - <p>En exécution de la présente convention, l’organisme LE FILAMENT s’engage à organiser l’action de formation intitulée : <span t-field="doc.course_id.name" /></p> - <p>L’objet, le programme, les méthodes pédagogiques, l’évaluation de cette formation relèvent de l’acquisition, de l’entretien ou du perfectionnement des connaissances (article L6313-1 du Code du Travail).</p> - <p> - Objectif de formation : <br/> - <span t-field="doc.course_id.objective" /> - </p> - </div> - <div class="subblock"> - <h3>ARTICLE 2 – LIEU ET DATE DE LA FORMATION</h3> - <table class="table table-borderless table-sm" style="border: 0px; border-color: transparent;"> - <tbody style="border: 0px;"> - <tr style="border: 0px;"> - <td style="width: 160px; border: 0px;">Lieu :</td> - <td style="border: 0px;"><span t-field="doc.place" /></td> - </tr> - <tr> - <td style="width: 160px; border: 0px;">Dates :</td> - <td style="border: 0px;">Du <span t-field="doc.date_begin" /> au <span t-field="doc.date_end" /></td> - </tr> - <tr style="border: 0px;"> - <td style="width: 160px; border: 0px;">Durée :</td> - <td style="border: 0px;"><span t-esc="doc.hours" />h</td> - </tr> - </tbody> - </table> - </div> - <div class="subblock"> - <h3>ARTICLE 3 – STAGIAIRES BENEFICIAIRES DE L’ACTION</h3> - <p>L’entreprise signataire inscrit à cette formation les personnes suivantes :</p> - <t t-foreach="doc.student_ids" t-as="student"> - <strong><span t-field="student.student_id.lastname" /> <span t-field="student.student_id.firstname" /></strong><br/> - </t> - <p>Nombre d'inscrit(s) : <strong><span t-esc="doc.students_count" /></strong></p> - </div> - <div class="subblock"> - <h3>ARTICLE 4 – MODALITES FINANCIERES</h3> - <p>Le coût de la formation, objet de la présente convention, s’élève à : </p> - <table class="table table-borderless table-sm"> - <thead> - <tr> - <th>Intitulé</th> - <th>Prix HT</th> - <th>TVA</th> - <th>Prix TTC</th> - </tr> - </thead> - <tbody> - <tr> - <td><span t-field="doc.course_id.name" /></td> - <td><span t-esc="doc.cost" /> €</td> - <td><span t-esc="doc.cost * 0.2" /> €</td> - <td><span t-esc="doc.cost * 1.2" /> €</td> - </tr> - </tbody> - </table> - <p>Cette somme couvre l’intégralité des frais engagés par l’organisme de formation pour cette session.</p> - </div> - <div class="subblock"> - <h3>ARTICLE 5 – MOYENS PEDAGOGIQUES ET TECHNIQUES MIS EN OEUVRE</h3> - <p><span t-field="doc.course_id.means" /></p> - </div> - <div class="subblock"> - <h3>ARTICLE 6 – MOYENS PERMETTANT D’APPRECIER LES RESULTATS DE L’ACTION</h3> - <p><span t-field="doc.course_id.evaluation" /></p> - </div> - <div class="subblock"> - <h3>ARTICLE 7 – MOYENS PERMETTANT DE SUIVRE L’EXECUTION DE L’ACTION</h3> - <p><span t-field="doc.course_id.control" /></p> - </div> - <div class="subblock"> - <h3>ARTICLE 8 – SANCTION DE LA FORMATION</h3> - <p>En application de l’article L6353-1 du Code du Travail, une attestation mentionnant les objectifs, la nature et la durée de l’action, les résultats de l’évaluation des acquis de la formation sera transmise aux stagiaires à l’issue de la formation.</p> - </div> - <div class="subblock"> - <h3>ARTICLE 9 – DELAI DE RETRACTATION ET CONDITIONS D’ANNULATION</h3> - <p>Conformément à la législation en vigueur (cf. Partie 6 du Code du Travail), l’entreprise signataire dispose d'un délai de 10 jours à compter de la signature de la présente convention pour se rétracter, par lettre recommandée avec accusé de réception.</p> - <p>Si, en cas de force majeure dûment reconnue, l’entreprise signataire est empêchée de suivre le programme de formation objet de la présente convention, elle pourra résilier ce contrat. Dans ce cas, seules les prestations effectivement dispensées seront dues prorata temporis de leur valeur prévue au contrat.</p> - <p>En cas de renoncement par LE FILAMENT à l’exécution de la présente convention, aucun règlement n’est dû et les sommes perçues sont remboursées.</p> - </div> - <div class="subblock"> - <h3>ARTICLE 10 – DROIT APPLICABLE</h3> - <p>Le présent contrat est régi par le droit français.</p> - <p>En cas de litige résultant de l'interprétation du présent contrat, de son exécution, ou en cas de rupture du lien contractuel, la juridiction compétente sera le tribunal de Toulouse.</p> - - <p class="mt32 mb32"> - Fait à Toulouse, le <span t-field="doc.date_convention" /> - </p> - <table class="table table-borderless" style="border: 0px; border-color: transparent;"> + </div> + <div class="subblock"> + <h3>ARTICLE 2 – LIEU ET DATE DE LA FORMATION</h3> + <table + class="table table-borderless table-sm" + style="border: 0px; border-color: transparent;" + > + <tbody style="border: 0px;"> + <tr style="border: 0px;"> + <td + style="width: 160px; border: 0px;" + >Lieu :</td> + <td style="border: 0px;"><span + t-field="doc.place" + /></td> + </tr> + <tr> + <td + style="width: 160px; border: 0px;" + >Dates :</td> + <td style="border: 0px;">Du <span + t-field="doc.date_begin" + /> au <span + t-field="doc.date_end" + /></td> + </tr> + <tr style="border: 0px;"> + <td + style="width: 160px; border: 0px;" + >Durée :</td> + <td style="border: 0px;"><span + t-esc="doc.hours" + />h</td> + </tr> + </tbody> + </table> + </div> + <div class="subblock"> + <h3 + >ARTICLE 3 – STAGIAIRES BENEFICIAIRES DE L’ACTION</h3> + <p + >L’entreprise signataire inscrit à cette formation les personnes suivantes :</p> + <t t-foreach="doc.student_ids" t-as="student"> + <strong><span + t-field="student.student_id.lastname" + /> <span + t-field="student.student_id.firstname" + /></strong><br /> + </t> + <p>Nombre d'inscrit(s) : <strong><span + t-esc="doc.students_count" + /></strong></p> + </div> + <div class="subblock"> + <h3>ARTICLE 4 – MODALITES FINANCIERES</h3> + <p + >Le coût de la formation, objet de la présente convention, s’élève à : </p> + <table class="table table-borderless table-sm"> + <thead> <tr> - <td style="border-color: #eee;"> - Pour <span t-field="doc.customer_id.name" /> <br/> - (Cachet et signature) - </td> - <td style="border: 0;"> - Pour LE FILAMENT <br/> - Benjamin RIVIER, Gérant<br/> - (Cachet et signature) - </td> + <th>Intitulé</th> + <th>Prix HT</th> + <th>TVA</th> + <th>Prix TTC</th> </tr> - </table> - </div> + </thead> + <tbody> + <tr> + <td><span + t-field="doc.course_id.name" + /></td> + <td><span t-esc="doc.cost" /> €</td> + <td><span + t-esc="doc.cost * 0.2" + /> €</td> + <td><span + t-esc="doc.cost * 1.2" + /> €</td> + </tr> + </tbody> + </table> + <p + >Cette somme couvre l’intégralité des frais engagés par l’organisme de formation pour cette session.</p> + </div> + <div class="subblock"> + <h3 + >ARTICLE 5 – MOYENS PEDAGOGIQUES ET TECHNIQUES MIS EN OEUVRE</h3> + <p><span t-field="doc.course_id.means" /></p> + </div> + <div class="subblock"> + <h3 + >ARTICLE 6 – MOYENS PERMETTANT D’APPRECIER LES RESULTATS DE L’ACTION</h3> + <p><span t-field="doc.course_id.evaluation" /></p> + </div> + <div class="subblock"> + <h3 + >ARTICLE 7 – MOYENS PERMETTANT DE SUIVRE L’EXECUTION DE L’ACTION</h3> + <p><span t-field="doc.course_id.control" /></p> + </div> + <div class="subblock"> + <h3>ARTICLE 8 – SANCTION DE LA FORMATION</h3> + <p + >En application de l’article L6353-1 du Code du Travail, une attestation mentionnant les objectifs, la nature et la durée de l’action, les résultats de l’évaluation des acquis de la formation sera transmise aux stagiaires à l’issue de la formation.</p> + </div> + <div class="subblock"> + <h3 + >ARTICLE 9 – DELAI DE RETRACTATION ET CONDITIONS D’ANNULATION</h3> + <p + >Conformément à la législation en vigueur (cf. Partie 6 du Code du Travail), l’entreprise signataire dispose d'un délai de 10 jours à compter de la signature de la présente convention pour se rétracter, par lettre recommandée avec accusé de réception.</p> + <p + >Si, en cas de force majeure dûment reconnue, l’entreprise signataire est empêchée de suivre le programme de formation objet de la présente convention, elle pourra résilier ce contrat. Dans ce cas, seules les prestations effectivement dispensées seront dues prorata temporis de leur valeur prévue au contrat.</p> + <p + >En cas de renoncement par LE FILAMENT à l’exécution de la présente convention, aucun règlement n’est dû et les sommes perçues sont remboursées.</p> + </div> + <div class="subblock"> + <h3>ARTICLE 10 – DROIT APPLICABLE</h3> + <p + >Le présent contrat est régi par le droit français.</p> + <p + >En cas de litige résultant de l'interprétation du présent contrat, de son exécution, ou en cas de rupture du lien contractuel, la juridiction compétente sera le tribunal de Toulouse.</p> + + <p class="mt32 mb32"> + Fait à Toulouse, le <span + t-field="doc.date_convention" + /> + </p> + <table + class="table table-borderless" + style="border: 0px; border-color: transparent;" + > + <tr> + <td style="border-color: #eee;"> + Pour <span + t-field="doc.customer_id.name" + /> <br /> + (Cachet et signature) + </td> + <td style="border: 0;"> + Pour LE FILAMENT <br /> + Benjamin RIVIER, Gérant<br /> + (Cachet et signature) + </td> + </tr> + </table> </div> - </div> - </div> - </t> + </div> + </div> + </div> </t> </t> - </template> + </t> + </template> - <record id="paperformat_a4_training" model="report.paperformat"> - <field name="name">A4 Formation</field> - <field name="default" eval="True"/> - <field name="format">A4</field> - <field name="orientation">Portrait</field> - <field name="margin_top">35</field> - <field name="margin_bottom">30</field> - <field name="margin_left">10</field> - <field name="margin_right">10</field> - <field name="header_line" eval="False"/> - <field name="header_spacing">30</field> - <field name="dpi">90</field> - </record> + <record id="paperformat_a4_training" model="report.paperformat"> + <field name="name">A4 Formation</field> + <field name="default" eval="True" /> + <field name="format">A4</field> + <field name="orientation">Portrait</field> + <field name="margin_top">35</field> + <field name="margin_bottom">30</field> + <field name="margin_left">10</field> + <field name="margin_right">10</field> + <field name="header_line" eval="False" /> + <field name="header_spacing">30</field> + <field name="dpi">90</field> + </record> - <record id="report_agreement_pdf" model="ir.actions.report"> - <field name="name">Formation - Convention</field> - <field name="model">training.training</field> - <field name="report_type">qweb-pdf</field> - <field name="report_name">lefilament_training.qweb_agreement_pdf</field> - <field name="binding_model_id" ref="model_training_training"/> - <field name="binding_type">report</field> - <field name="paperformat_id" ref="paperformat_a4_training"/> - </record> + <record id="report_agreement_pdf" model="ir.actions.report"> + <field name="name">Formation - Convention</field> + <field name="model">training.training</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">lefilament_training.qweb_agreement_pdf</field> + <field name="binding_model_id" ref="model_training_training" /> + <field name="binding_type">report</field> + <field name="paperformat_id" ref="paperformat_a4_training" /> + </record> - </data> -</odoo> \ No newline at end of file +</odoo> diff --git a/report/report_attendance_sheet.xml b/report/report_attendance_sheet.xml index b8719f6d2ab4bc409bc5ead28488a59a22f0a99e..7405954e70e0d13969a6f3a91226056167855b7f 100644 --- a/report/report_attendance_sheet.xml +++ b/report/report_attendance_sheet.xml @@ -1,123 +1,196 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2019-2022 Le Filament (<https://le-filament.com>) + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <data> + <template id="qweb_attendance_sheet_pdf"> + <t t-call="web.html_container"> + <t t-foreach="docs" t-as="doc"> + <t t-call="web.external_layout"> - <template id="qweb_attendance_sheet_pdf"> - <t t-call="web.html_container"> - <t t-foreach="docs" t-as="doc"> - <t t-call="web.external_layout"> - - <!-- gestion du nombre de sessions par page = 8 --> - <t t-set="nb_case" t-value="8" /> - <t t-set="nb_page" t-value="int(len(doc.session_ids)/nb_case) + 1" /> - - <div class="page"> - <t t-foreach="nb_page" t-as="page"> - <div class="row attendance"> - <div class="col-12 content-pdf" > - - <div class="col-12 text-center"> - <h1> - FORMATION : <span t-field="doc.course_id.name" /> - </h1> - <hr/> - <h2> - Feuille d'émargement - </h2> - </div> - <div class="col-6"> - <strong>Lieu : </strong><span t-field="doc.place" /><br/> - <strong>Dates : </strong>du <span t-field="doc.date_begin" /> au <span t-field="doc.date_end" /><br/> - <strong>Durée : </strong><span t-field="doc.hours" />h - </div> - <div class="col-6"> - <t t-if="doc.file_number"> - <strong>N° Dossier : </strong><span t-field="doc.file_number" /><br/> - </t> - <t t-if="doc.plan"> - <strong>Dispositif : </strong><span t-field="doc.plan" /> - </t> - </div> - <div class="col-12 mt16 mb16"> - <table class="table table-bordered" > - <thead> - <tr> - <th scope="col" style="vertical-align: middle; width: 100px;">Nom</th> - <th scope="col" style="vertical-align: middle; width: 100px;">Prénom</th> - <t t-foreach="doc.session_ids[nb_case * page_index:nb_case * (page_index + 1)]" t-as="session"> - <th scope="row" style="vertical-align: middle; width: 100px;"> - <span t-field="session.date" t-options='{"format": "dd/MM/yyyy"}'/><br /> - Début : <span t-field="session.date" t-options='{"format": "HH:mm"}'/><br /> - Durée : <span t-esc="session.date_delay" />h - </th> + <!-- gestion du nombre de sessions par page = 8 --> + <t t-set="nb_case" t-value="8" /> + <t + t-set="nb_page" + t-value="int(len(doc.session_ids)/nb_case) + 1" + /> + + <div class="page"> + <t t-foreach="nb_page" t-as="page"> + <div class="row attendance"> + <div class="col-12 content-pdf"> + + <div class="col-12 text-center"> + <h1> + FORMATION : <span + t-field="doc.course_id.name" + /> + </h1> + <hr /> + <h2> + Feuille d'émargement + </h2> + </div> + <div class="col-6"> + <strong>Lieu : </strong><span + t-field="doc.place" + /><br /> + <strong>Dates : </strong>du <span + t-field="doc.date_begin" + /> au <span t-field="doc.date_end" /><br /> + <strong>Durée : </strong><span + t-field="doc.hours" + />h + </div> + <div class="col-6"> + <t t-if="doc.file_number"> + <strong>N° Dossier : </strong><span + t-field="doc.file_number" + /><br /> + </t> + <t t-if="doc.plan"> + <strong>Dispositif : </strong><span + t-field="doc.plan" + /> + </t> + </div> + <div class="col-12 mt16 mb16"> + <table class="table table-bordered"> + <thead> + <tr> + <th + scope="col" + style="vertical-align: middle; width: 100px;" + >Nom</th> + <th + scope="col" + style="vertical-align: middle; width: 100px;" + >Prénom</th> + <t + t-foreach="doc.session_ids[nb_case * page_index:nb_case * (page_index + 1)]" + t-as="session" + > + <th + scope="row" + style="vertical-align: middle; width: 100px;" + > + <span + t-field="session.date" + t-options='{"format": "dd/MM/yyyy"}' + /><br /> + Début : <span + t-field="session.date" + t-options='{"format": "HH:mm"}' + /><br /> + Durée : <span + t-esc="session.date_delay" + />h + </th> + </t> + </tr> + </thead> + <tbody> + <t + t-set="length" + t-value="nb_case + 2" + /> + <tr style="background-color: #eee;"> + <td + t-att-colspan="length" + >Stagiaires</td> + </tr> + <t + t-foreach="doc.student_ids" + t-as="student" + > + <tr style="height: 60px;"> + <th + scope="col" + style="vertical-align: middle;" + ><span + t-field="student.student_id.lastname" + /></th> + <th + scope="col" + style="vertical-align: middle;" + ><span + t-field="student.student_id.firstname" + /></th> + <t + t-foreach="doc.session_ids[nb_case * page_index:nb_case * (page_index + 1)]" + t-as="session" + > + <td> + </td> </t> </tr> - </thead> - <tbody> - <t t-set="length" t-value="nb_case + 2" /> - <tr style="background-color: #eee;"> - <td t-att-colspan="length">Stagiaires</td> - </tr> - <t t-foreach="doc.student_ids" t-as="student"> - <tr style="height: 60px;"> - <th scope="col" style="vertical-align: middle;"><span t-field="student.student_id.lastname" /></th> - <th scope="col" style="vertical-align: middle;"><span t-field="student.student_id.firstname" /></th> - <t t-foreach="doc.session_ids[nb_case * page_index:nb_case * (page_index + 1)]" t-as="session"> - <td> - </td> - </t> - </tr> - </t> - <t t-set="trainers" t-value="doc._get_trainers()"/> - <tr style="background-color: #eee;"> - <td t-att-colspan="length">Formateur(s)</td> + </t> + <t + t-set="trainers" + t-value="doc._get_trainers()" + /> + <tr style="background-color: #eee;"> + <td + t-att-colspan="length" + >Formateur(s)</td> + </tr> + <t t-foreach="trainers" t-as="trainer"> + <tr style="height: 60px;"> + <th + scope="col" + style="vertical-align: middle;" + ><span + t-field="trainer.lastname" + /></th> + <th + scope="col" + style="vertical-align: middle;" + ><span + t-field="trainer.firstname" + /></th> + <t + t-foreach="doc.session_ids[nb_case * page_index:nb_case * (page_index + 1)]" + t-as="session" + > + <td> + </td> + </t> </tr> - <t t-foreach="trainers" t-as="trainer"> - <tr style="height: 60px;"> - <th scope="col" style="vertical-align: middle;"><span t-field="trainer.lastname" /></th> - <th scope="col" style="vertical-align: middle;"><span t-field="trainer.firstname" /></th> - <t t-foreach="doc.session_ids[nb_case * page_index:nb_case * (page_index + 1)]" t-as="session"> - <td> - </td> - </t> - </tr> - </t> - </tbody> - </table> - </div> + </t> + </tbody> + </table> </div> </div> - </t> - </div> + </div> + </t> + </div> - </t> </t> </t> - </template> + </t> + </template> - <record id="paperformat_a4_landscape" model="report.paperformat"> - <field name="name">A4 Paysage</field> - <field name="default" eval="True"/> - <field name="format">A4</field> - <field name="orientation">Landscape</field> - <field name="margin_top">10</field> - <field name="margin_bottom">25</field> - <field name="margin_left">10</field> - <field name="margin_right">10</field> - <field name="header_line" eval="False"/> - <field name="header_spacing">0</field> - <field name="dpi">90</field> - </record> + <record id="paperformat_a4_landscape" model="report.paperformat"> + <field name="name">A4 Paysage</field> + <field name="default" eval="True" /> + <field name="format">A4</field> + <field name="orientation">Landscape</field> + <field name="margin_top">10</field> + <field name="margin_bottom">25</field> + <field name="margin_left">10</field> + <field name="margin_right">10</field> + <field name="header_line" eval="False" /> + <field name="header_spacing">0</field> + <field name="dpi">90</field> + </record> - <record id="report_attendance_sheet_pdf" model="ir.actions.report"> - <field name="name">Formation - Feuille d'émargement</field> - <field name="model">training.training</field> - <field name="report_type">qweb-pdf</field> - <field name="report_name">lefilament_training.qweb_attendance_sheet_pdf</field> - <field name="binding_model_id" ref="model_training_training"/> - <field name="binding_type">report</field> - <field name="paperformat_id" ref="paperformat_a4_training"/> - </record> + <record id="report_attendance_sheet_pdf" model="ir.actions.report"> + <field name="name">Formation - Feuille d'émargement</field> + <field name="model">training.training</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">lefilament_training.qweb_attendance_sheet_pdf</field> + <field name="binding_model_id" ref="model_training_training" /> + <field name="binding_type">report</field> + <field name="paperformat_id" ref="paperformat_a4_training" /> + </record> - </data> -</odoo> \ No newline at end of file +</odoo> diff --git a/report/report_attestation.xml b/report/report_attestation.xml index e69a4c3d3920bf74c875dd927890c0c02db0c1ef..80290a2034347c0a6f2ccd36417d3941a86803a2 100644 --- a/report/report_attestation.xml +++ b/report/report_attestation.xml @@ -1,79 +1,118 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2019-2022 Le Filament (<https://le-filament.com>) + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <data> + <template id="qweb_attestation_pdf"> + <t t-call="web.html_container"> + <t t-foreach="docs" t-as="doc"> + <t t-foreach="doc.student_ids" t-as="student"> + <t t-call="web.external_layout"> + <div class="page"> + <div class="row convention"> + <div class="col-12"> + <div class="col-12 text-center"> + <h1>ATTESTATION DE FIN DE FORMATION</h1> + </div> + <div class="col-12" style="margin-top: 20px;"> + <p + >Je soussigné, Benjamin RIVIER, agissant en qualité de gérant au sein de l’organisme de formation Le Filament, enregistré sous le numéro 73310810731, atteste que :</p> + <p><strong><span + t-field="student.student_id.name" + /></strong></p> + <p>Salarié(e) de la société <strong><span + t-field="doc.customer_id.name" + /></strong>, située au <span + t-field="doc.customer_id.street" + />, <span + t-field="doc.customer_id.zip" + /> <span + t-field="doc.customer_id.city" + />,</p> + <p>A suivi la formation suivante :</p> + <h2 class="text-center"><span + t-field="doc.course_id.name" + /></h2> - <template id="qweb_attestation_pdf"> - <t t-call="web.html_container"> - <t t-foreach="docs" t-as="doc"> - <t t-foreach="doc.student_ids" t-as="student"> - <t t-call="web.external_layout"> - <div class="page"> - <div class="row convention"> - <div class="col-12" > - <div class="col-12 text-center"> - <h1>ATTESTATION DE FIN DE FORMATION</h1> - </div> - <div class="col-12" style="margin-top: 20px;"> - <p>Je soussigné, Benjamin RIVIER, agissant en qualité de gérant au sein de l’organisme de formation Le Filament, enregistré sous le numéro 73310810731, atteste que :</p> - <p><strong><span t-field="student.student_id.name" /></strong></p> - <p>Salarié(e) de la société <strong><span t-field="doc.customer_id.name" /></strong>, située au <span t-field="doc.customer_id.street" />, <span t-field="doc.customer_id.zip" /> <span t-field="doc.customer_id.city" />,</p> - <p>A suivi la formation suivante :</p> - <h2 class="text-center"><span t-field="doc.course_id.name" /></h2> - - <h3>OBJECTIFS DE LA FORMATION</h3> - <p t-field="doc.course_id.objective" /> + <h3>OBJECTIFS DE LA FORMATION</h3> + <p t-field="doc.course_id.objective" /> - <h3>NATURE DE L’ACTION DE FORMATION</h3> - <p t-field="doc.course_id.nature" /> + <h3>NATURE DE L’ACTION DE FORMATION</h3> + <p t-field="doc.course_id.nature" /> - <h3>MODALITÉS DE LA FORMATION</h3> - <table class="table table-striped"> - <tbody> - <tr> - <td style="width: 120px;"><strong>Dates</strong></td> - <td>Du <span t-field="doc.date_begin" /> au <span t-field="doc.date_end" /></td> - <td style="width: 120px;"><strong>Lieu</strong></td> - <td><span t-field="doc.place" /></td> - </tr> - <tr> - <td style="width: 120px;"><strong>Durée</strong></td> - <td><span t-esc="doc.hours" /> heures</td> - <td style="width: 120px;"><strong>Intervenant(s)</strong></td> - <td> - <t t-set="trainers" t-value="doc._get_trainers()"/> - <t t-foreach="trainers" t-as="trainer"> - <span t-field="trainer.lastname" /> <span t-field="trainer.firstname" />, - </t> - </td> - </tr> - </tbody> - </table> + <h3>MODALITÉS DE LA FORMATION</h3> + <table class="table table-striped"> + <tbody> + <tr> + <td style="width: 120px;"><strong + >Dates</strong></td> + <td>Du <span + t-field="doc.date_begin" + /> au <span + t-field="doc.date_end" + /></td> + <td style="width: 120px;"><strong + >Lieu</strong></td> + <td><span + t-field="doc.place" + /></td> + </tr> + <tr> + <td style="width: 120px;"><strong + >Durée</strong></td> + <td><span + t-esc="doc.hours" + /> heures</td> + <td style="width: 120px;"><strong + >Intervenant(s)</strong></td> + <td> + <t + t-set="trainers" + t-value="doc._get_trainers()" + /> + <t + t-foreach="trainers" + t-as="trainer" + > + <span + t-field="trainer.lastname" + /> <span + t-field="trainer.firstname" + />, + </t> + </td> + </tr> + </tbody> + </table> - <h3>ACQUIS DE LA FORMATION</h3> - <p t-field="doc.course_id.acquis" /> - </div> - <div class="col-offset-8 col-4" style="margin-top: 20px;"> - Pour valoir ce que de droit <br/> - Fait à Toulouse, le <span t-field="doc.date_attestation" /> - </div> + <h3>ACQUIS DE LA FORMATION</h3> + <p t-field="doc.course_id.acquis" /> + </div> + <div + class="col-offset-8 col-4" + style="margin-top: 20px;" + > + Pour valoir ce que de droit <br /> + Fait à Toulouse, le <span + t-field="doc.date_attestation" + /> </div> - </div> - </div> - </t> + </div> + </div> + </div> </t> </t> </t> - </template> + </t> + </template> - <record id="report_attestation_pdf" model="ir.actions.report"> - <field name="name">Formation - Attestations</field> - <field name="model">training.training</field> - <field name="report_type">qweb-pdf</field> - <field name="report_name">lefilament_training.qweb_attestation_pdf</field> - <field name="binding_model_id" ref="model_training_training"/> - <field name="binding_type">report</field> - <field name="paperformat_id" ref="paperformat_a4_training"/> - </record> + <record id="report_attestation_pdf" model="ir.actions.report"> + <field name="name">Formation - Attestations</field> + <field name="model">training.training</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">lefilament_training.qweb_attestation_pdf</field> + <field name="binding_model_id" ref="model_training_training" /> + <field name="binding_type">report</field> + <field name="paperformat_id" ref="paperformat_a4_training" /> + </record> - </data> -</odoo> \ No newline at end of file +</odoo> diff --git a/report/report_program.xml b/report/report_program.xml index 3af3f0ce124cc8dd80c350bd7df9b0995a0474a9..66fc9f84818c1273b42a52d4fe7e6b435abb847f 100644 --- a/report/report_program.xml +++ b/report/report_program.xml @@ -1,92 +1,117 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2019-2022 Le Filament (<https://le-filament.com>) + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <data> - - <template id="qweb_program_pdf"> - <t t-call="web.html_container"> - <t t-foreach="docs" t-as="doc"> - <t t-call="web.external_layout"> - <div class="page"> - <div class="row convention"> - <div class="col-12" > - <div class="text-center"> - <h1><span t-field="doc.course_id.name" /></h1> - <h2>Programme de formation</h2> - </div> - <div class="subblock"> - <h3>1. DESCRIPTION</h3> - <p t-field="doc.course_id.description" /> - </div> - <div class="subblock"> - <h3>2. OBJECTIFS / COMPÉTENCES VISÉES</h3> - <p t-field="doc.course_id.objective" /> - </div> - <div class=""> - <h3>3. PROGRAMME DE LA FORMATION</h3> - <t t-foreach="doc.session_ids" t-as="session"> - <div class="subblock"> - <h4 style="margin-left: 40px;">3.<span t-esc="'%01d' % (session_index+1)"/> <span t-field="session.session_id.name" /></h4> - <p style="margin-bottom: 40px;"><span t-field="session.session_id.description" /></p> - </div> - </t> - </div> - <div class="subblock"> - <h3>4. MÉTHODOLOGIE ET SUPPORTS PÉDAGOGIQUES</h3> - <span t-field="doc.course_id.method" /> - </div> - <div class="subblock"> - <h3>5. MOYENS PÉDAGOGIQUES D'ENCADREMENT</h3> - <span t-field="doc.course_id.means" /> - </div> - <div class="subblock"> - <h3>6. SUIVI DE L’EXÉCUTION</h3> - <span t-field="doc.course_id.control" /> - </div> - <div class="subblock"> - <h3>7. MODALITÉS D'ÉVALUATION</h3> - <span t-field="doc.course_id.evaluation" /> - </div> - <div class="subblock"> - <h3>8. MODALITÉS ET DURÉE DE LA FORMATION</h3> - <p>Formation dispensée en intra-entreprise par groupes de <span t-field="doc.students_nb_prev" /> personnes, et par session de demi-journées, afin de s’adapter aux contraintes de disponibilité de l’entreprise.</p> - <p>Horaires : <strong><span t-field="doc.session_hours" /></strong></p> - <p><strong><span t-field="doc.session_count" /> sessions</strong> de formation, soit <strong><span t-field="doc.hours" /> heures par personne</strong></p> - </div> - <div class="subblock"> - <h3>9. LIEU ET DÉLAIS DE LA FORMATION</h3> - <p t-field="doc.place" /> - <p>Du <span t-field="doc.date_begin" /> au <span t-field="doc.date_end" /></p> - </div> - <div class="subblock"> - <h3>10. COÛT DE LA FORMATION</h3> - <p> - <span t-field="doc.cost" /> € HT en formation INTRA de <span t-field="doc.students_nb_prev" /> personnes. - </p> - </div> - <div class="subblock"> - <h3>11. LES STAGIAIRES</h3> - <span t-field="doc.course_id.students_profile" /> - </div> - <div class="text-center"> - <img src="/lefilament_training/static/src/img/logo-datadock.jpg" style="max-width: 80px;" class="mt64" /> - </div> + <template id="qweb_program_pdf"> + <t t-call="web.html_container"> + <t t-foreach="docs" t-as="doc"> + <t t-call="web.external_layout"> + <div class="page"> + <div class="row convention"> + <div class="col-12"> + <div class="text-center"> + <h1><span t-field="doc.course_id.name" /></h1> + <h2>Programme de formation</h2> + </div> + <div class="subblock"> + <h3>1. DESCRIPTION</h3> + <p t-field="doc.course_id.description" /> + </div> + <div class="subblock"> + <h3>2. OBJECTIFS / COMPÉTENCES VISÉES</h3> + <p t-field="doc.course_id.objective" /> + </div> + <div class=""> + <h3>3. PROGRAMME DE LA FORMATION</h3> + <t t-foreach="doc.session_ids" t-as="session"> + <div class="subblock"> + <h4 style="margin-left: 40px;">3.<span + t-esc="'%01d' % (session_index+1)" + /> <span + t-field="session.session_id.name" + /></h4> + <p style="margin-bottom: 40px;"><span + t-field="session.session_id.description" + /></p> + </div> + </t> + </div> + <div class="subblock"> + <h3>4. MÉTHODOLOGIE ET SUPPORTS PÉDAGOGIQUES</h3> + <span t-field="doc.course_id.method" /> + </div> + <div class="subblock"> + <h3>5. MOYENS PÉDAGOGIQUES D'ENCADREMENT</h3> + <span t-field="doc.course_id.means" /> + </div> + <div class="subblock"> + <h3>6. SUIVI DE L’EXÉCUTION</h3> + <span t-field="doc.course_id.control" /> + </div> + <div class="subblock"> + <h3>7. MODALITÉS D'ÉVALUATION</h3> + <span t-field="doc.course_id.evaluation" /> + </div> + <div class="subblock"> + <h3>8. MODALITÉS ET DURÉE DE LA FORMATION</h3> + <p + >Formation dispensée en intra-entreprise par groupes de <span + t-field="doc.students_nb_prev" + /> personnes, et par session de demi-journées, afin de s’adapter aux contraintes de disponibilité de l’entreprise.</p> + <p>Horaires : <strong><span + t-field="doc.session_hours" + /></strong></p> + <p><strong><span + t-field="doc.session_count" + /> sessions</strong> de formation, soit <strong + ><span + t-field="doc.hours" + /> heures par personne</strong></p> + </div> + <div class="subblock"> + <h3>9. LIEU ET DÉLAIS DE LA FORMATION</h3> + <p t-field="doc.place" /> + <p>Du <span t-field="doc.date_begin" /> au <span + t-field="doc.date_end" + /></p> + </div> + <div class="subblock"> + <h3>10. COÛT DE LA FORMATION</h3> + <p> + <span + t-field="doc.cost" + /> € HT en formation INTRA de <span + t-field="doc.students_nb_prev" + /> personnes. + </p> + </div> + <div class="subblock"> + <h3>11. LES STAGIAIRES</h3> + <span t-field="doc.course_id.students_profile" /> + </div> + <div class="text-center"> + <img + src="/lefilament_training/static/src/img/logo-datadock.jpg" + style="max-width: 80px;" + class="mt64" + /> </div> </div> - </div> - </t> + </div> + </div> </t> </t> - </template> + </t> + </template> - <record id="report_program_pdf" model="ir.actions.report"> - <field name="name">Formation - Programme</field> - <field name="model">training.training</field> - <field name="report_type">qweb-pdf</field> - <field name="report_name">lefilament_training.qweb_program_pdf</field> - <field name="binding_model_id" ref="model_training_training"/> - <field name="binding_type">report</field> - <field name="paperformat_id" ref="paperformat_a4_training"/> - </record> + <record id="report_program_pdf" model="ir.actions.report"> + <field name="name">Formation - Programme</field> + <field name="model">training.training</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">lefilament_training.qweb_program_pdf</field> + <field name="binding_model_id" ref="model_training_training" /> + <field name="binding_type">report</field> + <field name="paperformat_id" ref="paperformat_a4_training" /> + </record> - </data> </odoo> diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv index 0359c86e40ccb1319fa4d8a637ce9f68b51de107..e66679b8c513e197eb2356c204214c791fec8635 100644 --- a/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -3,4 +3,4 @@ access_training_training_group_user,training.training,model_training_training,gr access_training_session_group_user,training.session,model_training_session,group_training,1,1,1,1 access_training_student_group_user,training.student,model_training_student,group_training,1,1,1,1 access_training_course_group_user,training.course,model_training_course,group_training,1,1,1,1 -access_training_course_session_group_user,training.course.session,model_training_course_session,group_training,1,1,1,1 \ No newline at end of file +access_training_course_session_group_user,training.course.session,model_training_course_session,group_training,1,1,1,1 diff --git a/security/training_security.xml b/security/training_security.xml index ab52b5cfe4651a6d2225db20331496b18db473c7..5f630a72cf69347b29f00202b25040c03dcfc18d 100644 --- a/security/training_security.xml +++ b/security/training_security.xml @@ -1,15 +1,12 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright 2017 Le Filament (<https://www.le-filament.com>) +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2019-2022 Le Filament (<https://le-filament.com>) License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <data noupdate="0"> + <!-- Définition des groupes utilisateurs --> + <record id="group_training" model="res.groups"> + <field name="name">Gestionnaire de Formation</field> + <field name="category_id" ref="module_category_training" /> + <field name="implied_ids" eval="[(4, ref('base.group_user'))]" /> + </record> - <!-- Définition des groupes utilisateurs --> - <record id="group_training" model="res.groups"> - <field name="name">Gestionnaire de Formation</field> - <field name="category_id" ref="module_category_training"/> - <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/> - </record> - - </data> -</odoo> \ No newline at end of file +</odoo> diff --git a/static/src/fonts/Lato/OFL.txt b/static/src/fonts/Lato/OFL.txt index dfca0da4bcdadf6fa32bed29ecc49ac0e6915b64..4d308fb87e4c7d4237c37a099268045b99b5246e 100644 --- a/static/src/fonts/Lato/OFL.txt +++ b/static/src/fonts/Lato/OFL.txt @@ -1,93 +1,93 @@ -Copyright (c) 2010-2014 by tyPoland Lukasz Dziedzic (team@latofonts.com) with Reserved Font Name "Lato" - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. +Copyright (c) 2010-2014 by tyPoland Lukasz Dziedzic (team@latofonts.com) with Reserved Font Name "Lato" + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/static/src/fonts/Lekton/OFL.txt b/static/src/fonts/Lekton/OFL.txt index dbe228bbf6341e745dd171dca3f6586e1982e1f2..b34b58d54939a4ee92229f8999ec0d1ccf59572b 100644 --- a/static/src/fonts/Lekton/OFL.txt +++ b/static/src/fonts/Lekton/OFL.txt @@ -1,93 +1,93 @@ -Copyright (c) 2008-2010, Isia Urbino (http://www.isiaurbino.net) - -This Font Software is licensed under the SIL Open Font License, Version 1.1. -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. +Copyright (c) 2008-2010, Isia Urbino (http://www.isiaurbino.net) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/static/src/scss/style.scss b/static/src/scss/style.scss index 9b6b5ae629f7310716712039fae877628678db46..85d02e5845cf37fa7de0a3bc9618f3ee46e7ac39 100644 --- a/static/src/scss/style.scss +++ b/static/src/scss/style.scss @@ -2,116 +2,124 @@ /** Fonts ***************************/ @font-face { - font-family: 'Lato'; - src: url(../fonts/Lato/Lato-Regular.ttf); - font-weight: normal; - font-style: normal; + font-family: "Lato"; + src: url(../fonts/Lato/Lato-Regular.ttf); + font-weight: normal; + font-style: normal; } @font-face { - font-family: 'Lato'; - src: url(../fonts/Lato/Lato-Light.ttf); - font-weight: 300; - font-style: normal; + font-family: "Lato"; + src: url(../fonts/Lato/Lato-Light.ttf); + font-weight: 300; + font-style: normal; } @font-face { - font-family: 'Lato'; - src: url(../fonts/Lato/Lato-Bold.ttf); - font-weight: bold; - font-style: normal; + font-family: "Lato"; + src: url(../fonts/Lato/Lato-Bold.ttf); + font-weight: bold; + font-style: normal; } @font-face { - font-family: 'Lekton'; - src: url(../fonts/Lekton/Lekton-Regular.ttf); - font-weight: normal; - font-style: normal; + font-family: "Lekton"; + src: url(../fonts/Lekton/Lekton-Regular.ttf); + font-weight: normal; + font-style: normal; } @font-face { - font-family: 'Lekton'; - src: url(../fonts/Lekton/Lekton-Bold.ttf); - font-weight: bold; - font-style: normal; + font-family: "Lekton"; + src: url(../fonts/Lekton/Lekton-Bold.ttf); + font-weight: bold; + font-style: normal; } /*************************** /** Variables ***************************/ -$typo_body: 'Lato',sans-serif; -$typo_1: 'Lekton', sans-serif; +$typo_body: "Lato", sans-serif; +$typo_1: "Lekton", sans-serif; -$color1: #1C2F82; +$color1: #1c2f82; $color2: rgb(0, 180, 149); - /*************************** /** Global ***************************/ -body, table, td, span, div { - font-family: inherit; +body, +table, +td, +span, +div { + font-family: inherit; } -.attendance {page-break-after: always;} +.attendance { + page-break-after: always; +} .subblock { - page-break-inside: avoid; + page-break-inside: avoid; } -.attendance, .attendance td, .convention, .convention td { - font-family: $typo_body; - font-weight: 300; +.attendance, +.attendance td, +.convention, +.convention td { + font-family: $typo_body; + font-weight: 300; } .training-footer { - border-top: 1px solid #eee; - padding-top: 10px; - font-size: 11px; - font-family: $typo_1; - text-align: center; - color: #333; + border-top: 1px solid #eee; + padding-top: 10px; + font-size: 11px; + font-family: $typo_1; + text-align: center; + color: #333; } /*************************** /** Attendance ***************************/ .attendance h1 { - color: $color2; - font-size: 26px; - font-family: $typo_1; - text-transform: uppercase; + color: $color2; + font-size: 26px; + font-family: $typo_1; + text-transform: uppercase; } .attendance h2 { - color: $color1; - font-size: 22px; - font-family: $typo_1; + color: $color1; + font-size: 22px; + font-family: $typo_1; } /*************************** /** Convention ***************************/ .convention h1 { - background-color: $color2; - color: #fff; - padding: 5px 0; - font-size: 26px; - font-family: $typo_1; - text-transform: uppercase; + background-color: $color2; + color: #fff; + padding: 5px 0; + font-size: 26px; + font-family: $typo_1; + text-transform: uppercase; } .convention h2 { - color: $color1; - font-size: 22px; - font-family: $typo_1; - text-transform: uppercase; + color: $color1; + font-size: 22px; + font-family: $typo_1; + text-transform: uppercase; } .convention h3 { - font-size: 18px; - color: #777; - border-bottom: 1px solid #eee; - padding-bottom: 5px; - margin-top: 32px; + font-size: 18px; + color: #777; + border-bottom: 1px solid #eee; + padding-bottom: 5px; + margin-top: 32px; } .convention h4 { - margin-left: 40px; - font-size: 16px; - color: #333; + margin-left: 40px; + font-size: 16px; + color: #333; } .convention p { - text-align: justify; -} \ No newline at end of file + text-align: justify; +} diff --git a/views/account_move_view.xml b/views/account_move_view.xml index 4d32af89f3aad9748adb6bf3f64b4f46ab6b49b1..c140ee8d9bcc38927f39488657250acfd8ec3be4 100644 --- a/views/account_move_view.xml +++ b/views/account_move_view.xml @@ -1,23 +1,22 @@ -<?xml version="1.0" encoding="utf-8"?> - +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2019-2022 Le Filament (<https://le-filament.com>) + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <data> - - <!-- Client Form View --> - <record id="account_invoice_training_form_view" model="ir.ui.view"> - <field name="name">Invoice Training Form View</field> - <field name="model">account.move</field> - <field name="inherit_id" ref="account.view_move_form"/> - <field name="arch" type="xml" > - <xpath expr="//page[@name='other_info']/group/group[2]" position="inside"> - <field - name="training_id" - domain="['|', ('customer_id', '=', partner_id), ('opco_id', '=', partner_id)]" - options="{ 'no_create_edit': True, }" /> - </xpath> - </field> - </record> - - </data> -</odoo> \ No newline at end of file + <!-- Client Form View --> + <record id="account_invoice_training_form_view" model="ir.ui.view"> + <field name="name">Invoice Training Form View</field> + <field name="model">account.move</field> + <field name="inherit_id" ref="account.view_move_form" /> + <field name="arch" type="xml"> + <xpath expr="//page[@name='other_info']/group/group[2]" position="inside"> + <field + name="training_id" + domain="['|', ('customer_id', '=', partner_id), ('opco_id', '=', partner_id)]" + options="{ 'no_create_edit': True, }" + /> + </xpath> + </field> + </record> + +</odoo> diff --git a/views/assets.xml b/views/assets.xml deleted file mode 100644 index dc6aa9e07b74ecacc557f037ccd960cdaf942809..0000000000000000000000000000000000000000 --- a/views/assets.xml +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<odoo> - <data> - - <template id="training_assets" inherit_id="web.report_assets_common"> - <xpath expr="." position="inside"> - <link rel="stylesheet" href="/lefilament_training/static/src/scss/style.scss"/> - </xpath> - </template> - - <template id="training_assets_common" name="training_assets" inherit_id="web.report_assets_pdf"> - <xpath expr="." position="inside"> - <link rel="stylesheet" href="/lefilament_training/static/src/scss/style.scss"/> - </xpath> - </template> - - <template id="report_assets_common_custom_fonts" name="Custom QWeb fonts" inherit_id="web.report_assets_common"> - <xpath expr="." position="inside"> - <link rel="stylesheet" href="/lefilament_training/static/src/scss/style.scss"/> - </xpath> - </template> - - </data> -</odoo> diff --git a/views/partner_view.xml b/views/partner_view.xml index 7ce5d9f9b19195bff87171a9d83605eff676a7bf..94aeb1be1b1b1916c965cf875f6d9f964dc93186 100644 --- a/views/partner_view.xml +++ b/views/partner_view.xml @@ -1,20 +1,18 @@ -<?xml version="1.0" encoding="utf-8"?> - +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2019-2022 Le Filament (<https://le-filament.com>) + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <data> - - <!-- Client Form View --> - <record id="res_partner_training_form_view" model="ir.ui.view"> - <field name="name">Parnter Training Form View</field> - <field name="model">res.partner</field> - <field name="inherit_id" ref="base.view_partner_form"/> - <field name="arch" type="xml" > - <xpath expr="//group[@name='sale']" position="inside"> - <field name="is_opco" /> - </xpath> - </field> - </record> - - </data> -</odoo> \ No newline at end of file + <!-- Client Form View --> + <record id="res_partner_training_form_view" model="ir.ui.view"> + <field name="name">Parnter Training Form View</field> + <field name="model">res.partner</field> + <field name="inherit_id" ref="base.view_partner_form" /> + <field name="arch" type="xml"> + <xpath expr="//group[@name='sale']" position="inside"> + <field name="is_opco" /> + </xpath> + </field> + </record> + +</odoo> diff --git a/views/sale_order_view.xml b/views/sale_order_view.xml index 6b2d9ac6e1348d464f541ff4164836db3ef21ef2..37cf14056019b27cbe522b0adf625f2e98a3819b 100644 --- a/views/sale_order_view.xml +++ b/views/sale_order_view.xml @@ -1,23 +1,22 @@ -<?xml version="1.0" encoding="utf-8"?> - +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2019-2022 Le Filament (<https://le-filament.com>) + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <data> - - <!-- Client Form View --> - <record id="sale_order_training_form_view" model="ir.ui.view"> - <field name="name">Sale Order Training Form View</field> - <field name="model">sale.order</field> - <field name="inherit_id" ref="sale.view_order_form"/> - <field name="arch" type="xml" > - <xpath expr="//group[@name='sale_info']" position="inside"> - <field - name="training_id" - domain="['|', ('customer_id', '=', partner_id), ('opco_id', '=', partner_id)]" - options="{ 'no_create_edit': True, }" /> - </xpath> - </field> - </record> - - </data> -</odoo> \ No newline at end of file + <!-- Client Form View --> + <record id="sale_order_training_form_view" model="ir.ui.view"> + <field name="name">Sale Order Training Form View</field> + <field name="model">sale.order</field> + <field name="inherit_id" ref="sale.view_order_form" /> + <field name="arch" type="xml"> + <xpath expr="//group[@name='sale_info']" position="inside"> + <field + name="training_id" + domain="['|', ('customer_id', '=', partner_id), ('opco_id', '=', partner_id)]" + options="{ 'no_create_edit': True, }" + /> + </xpath> + </field> + </record> + +</odoo> diff --git a/views/training_course_view.xml b/views/training_course_view.xml index 8142995251f0d1f1191e23cd0ffa6e415cf6c9e8..4db709e494a9164c711afa96d4b6a4596ecf49d5 100644 --- a/views/training_course_view.xml +++ b/views/training_course_view.xml @@ -1,132 +1,157 @@ -<?xml version="1.0" encoding="utf-8"?> - +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2019-2022 Le Filament (<https://le-filament.com>) + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <data> - <record id="training_course_form" model="ir.ui.view"> - <field name="name">Training Course Form View</field> - <field name="model">training.course</field> - <field name="arch" type="xml"> - <form string="Formation"> - <sheet> - <group> - <field name="name" /> - <field name="description" /> - <field name="objective" /> - <field name="duration_total" /> - </group> - <notebook> - <page name="sessions" string="Sessions"> - <field name="session_ids" context="{'default_course_id': active_id,}"> - <tree> - <field name="sequence" widget="handle"/> - <field name="name" /> - <field name="duration" /> - </tree> - </field> - </page> - <page name="detail" string="Détail"> - <group> - <field name="method" /> - <field name="means" /> - <field name="control" /> - <field name="evaluation" /> - <field name="students_profile" /> - <field name="nature" /> - <field name="acquis" /> - </group> - </page> - </notebook> - </sheet> - <div class="oe_chatter"> - <field name="message_follower_ids" widget="mail_followers" /> - <field name="message_ids" widget="mail_thread" /> - </div> - </form> - </field> - </record> + <record id="training_course_form" model="ir.ui.view"> + <field name="name">Training Course Form View</field> + <field name="model">training.course</field> + <field name="arch" type="xml"> + <form string="Formation"> + <sheet> + <group> + <field name="name" /> + <field name="description" /> + <field name="objective" /> + <field name="duration_total" /> + </group> + <notebook> + <page name="sessions" string="Sessions"> + <field + name="session_ids" + context="{'default_course_id': active_id,}" + > + <tree> + <field name="sequence" widget="handle" /> + <field name="name" /> + <field name="duration" /> + </tree> + </field> + </page> + <page name="detail" string="Détail"> + <group> + <field name="method" /> + <field name="means" /> + <field name="control" /> + <field name="evaluation" /> + <field name="students_profile" /> + <field name="nature" /> + <field name="acquis" /> + </group> + </page> + </notebook> + </sheet> + <div class="oe_chatter"> + <field name="message_follower_ids" widget="mail_followers" /> + <field name="message_ids" widget="mail_thread" /> + </div> + </form> + </field> + </record> - <!-- Tree View Programs --> - <record id="training_course_tree" model="ir.ui.view"> - <field name="name">Training Course Tree View</field> - <field name="model">training.course</field> - <field name="arch" type="xml"> - <tree string="Catalogue de formations" decoration-danger="duration_total == 0" > - <field name="name" /> - <field name="duration_total" /> - <field name="session_count" /> - </tree> - </field> - </record> + <!-- Tree View Programs --> + <record id="training_course_tree" model="ir.ui.view"> + <field name="name">Training Course Tree View</field> + <field name="model">training.course</field> + <field name="arch" type="xml"> + <tree decoration-danger="duration_total == 0"> + <field name="name" /> + <field name="duration_total" /> + <field name="session_count" /> + </tree> + </field> + </record> - <!-- Filtres et Champ de Recherche --> - <record id="training_course_search" model="ir.ui.view"> - <field name="name">Training Course Search View</field> - <field name="model">training.course</field> - <field name="arch" type="xml"> - <search> - <!-- Champs de recherche --> - <field name="name"/> - <!-- Groupes --> - <group expand="0" name="group_by" string="Group By"> - <filter string="Nombre de sessions" name ="group_duration_total" domain="[]" context="{'group_by' : 'duration_total'}" /> - </group> - </search> - </field> - </record> + <!-- Filtres et Champ de Recherche --> + <record id="training_course_search" model="ir.ui.view"> + <field name="name">Training Course Search View</field> + <field name="model">training.course</field> + <field name="arch" type="xml"> + <search> + <!-- Champs de recherche --> + <field name="name" /> + <!-- Groupes --> + <group expand="0" name="group_by" string="Group By"> + <filter + string="Nombre de sessions" + name="group_duration_total" + domain="[]" + context="{'group_by' : 'duration_total'}" + /> + </group> + </search> + </field> + </record> - <record id="training_course_session_form" model="ir.ui.view"> - <field name="name">Training Course Session Form View</field> - <field name="model">training.course.session</field> - <field name="arch" type="xml"> - <form string="Fomration"> - <sheet> - <group> - <field name="name" /> - <field name="description" /> - <field name="duration" /> - <field name="course_id" widget="many2many_tags"/> - </group> - </sheet> - </form> - </field> - </record> + <record id="training_course_session_form" model="ir.ui.view"> + <field name="name">Training Course Session Form View</field> + <field name="model">training.course.session</field> + <field name="arch" type="xml"> + <form string="Fomration"> + <sheet> + <group> + <field name="name" /> + <field name="description" /> + <field name="duration" /> + <field name="course_id" widget="many2many_tags" /> + </group> + </sheet> + </form> + </field> + </record> - <!-- Tree View Programs --> - <record id="training_course_session_tree" model="ir.ui.view"> - <field name="name">Training Course Session Tree View</field> - <field name="model">training.course.session</field> - <field name="arch" type="xml"> - <tree string="Modules"> - <field name="name" /> - <field name="duration" /> - <field name="course_id" /> - </tree> - </field> - </record> + <!-- Tree View Programs --> + <record id="training_course_session_tree" model="ir.ui.view"> + <field name="name">Training Course Session Tree View</field> + <field name="model">training.course.session</field> + <field name="arch" type="xml"> + <tree> + <field name="name" /> + <field name="duration" /> + <field name="course_id" /> + </tree> + </field> + </record> - <!-- ACTIONS --> - <record model="ir.actions.act_window" id="action_training_course"> - <field name="name">Catalogue de Formations</field> - <field name="res_model">training.course</field> - <field name="view_mode">tree,form,pivot,graph</field> - </record> + <!-- ACTIONS --> + <record model="ir.actions.act_window" id="action_training_course"> + <field name="name">Catalogue de Formations</field> + <field name="res_model">training.course</field> + <field name="view_mode">tree,form,pivot,graph</field> + </record> - <record model="ir.actions.act_window" id="action_training_course_session"> - <field name="name">Sessions de Formations</field> - <field name="res_model">training.course.session</field> - <field name="view_mode">tree,form,pivot,graph</field> - </record> + <record model="ir.actions.act_window" id="action_training_course_session"> + <field name="name">Sessions de Formations</field> + <field name="res_model">training.course.session</field> + <field name="view_mode">tree,form,pivot,graph</field> + </record> - <!-- MENU --> - <menuitem - id="menu_training" - name="Formation" - sequence="160" - web_icon="lefilament_training,static/description/training.png"/> - <menuitem id="menu_training_course" name="Catalogue" sequence="40" parent="menu_training"/> - <menuitem id="menu_training_course_list" name="Programmes" sequence="10" parent="menu_training_course" action="action_training_course" /> - <menuitem id="menu_training_course_session" name="Modules" sequence="20" parent="menu_training_course" action="action_training_course_session" /> - </data> + <!-- MENU --> + <menuitem + id="menu_training" + name="Formation" + sequence="160" + web_icon="lefilament_training,static/description/training.png" + /> + <menuitem + id="menu_training_course" + name="Catalogue" + sequence="40" + parent="menu_training" + /> + <menuitem + id="menu_training_course_list" + name="Programmes" + sequence="10" + parent="menu_training_course" + action="action_training_course" + /> + <menuitem + id="menu_training_course_session" + name="Modules" + sequence="20" + parent="menu_training_course" + action="action_training_course_session" + /> </odoo> diff --git a/views/training_session_view.xml b/views/training_session_view.xml index 608c29e1ac9cee4420627ec97557dfe6dbcf8c18..78369e523adf1f479e94523c7c3787ea4f90cfc2 100644 --- a/views/training_session_view.xml +++ b/views/training_session_view.xml @@ -1,73 +1,91 @@ -<?xml version="1.0" encoding="utf-8"?> - +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2019-2022 Le Filament (<https://le-filament.com>) + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <data> - <record id="training_session_form" model="ir.ui.view"> - <field name="name">Training Session Form View</field> - <field name="model">training.session</field> - <field name="arch" type="xml"> - <form string="Formation"> - <sheet> - <group> - <field name="session_id" /> - <field name="date" /> - <field name="date_delay" /> - <field name="training_id" /> - <field name="customer_id" /> - <field name="user_id" /> - </group> - </sheet> - </form> - </field> - </record> - + <record id="training_session_form" model="ir.ui.view"> + <field name="name">Training Session Form View</field> + <field name="model">training.session</field> + <field name="arch" type="xml"> + <form string="Formation"> + <sheet> + <group> + <field name="session_id" /> + <field name="date" /> + <field name="date_delay" /> + <field name="training_id" /> + <field name="customer_id" /> + <field name="user_id" /> + </group> + </sheet> + </form> + </field> + </record> - <!-- Tree View --> - <record id="training_session_tree" model="ir.ui.view"> - <field name="name">Training session Tree View</field> - <field name="model">training.session</field> - <field name="arch" type="xml"> - <tree string="Liste des Sessions"> - <field name="date" /> - <field name="session_id" /> - <field name="training_id" /> - <field name="customer_id" /> - <field name="user_id" /> - </tree> - </field> - </record> - <!-- Filtres et Champ de Recherche --> - <record id="training_session_search" model="ir.ui.view"> - <field name="name">Training session Search View</field> - <field name="model">training.session</field> - <field name="arch" type="xml"> - <search> - <!-- Champs de recherche --> - <field name="session_id"/> - <field name="user_id"/> - <field name="training_id"/> - <field name="training_id"/> - <!-- Filtres --> + <!-- Tree View --> + <record id="training_session_tree" model="ir.ui.view"> + <field name="name">Training session Tree View</field> + <field name="model">training.session</field> + <field name="arch" type="xml"> + <tree> + <field name="date" /> + <field name="session_id" /> + <field name="training_id" /> + <field name="customer_id" /> + <field name="user_id" /> + </tree> + </field> + </record> - <!-- Groupes --> - <group expand="0" name="group_by" string="Group By"> - <filter string="Formateur" name="group_user" domain="[]" context="{'group_by' : 'user_id'}" /> - <filter string="Formation" name="group_training" domain="[]" context="{'group_by' : 'training_id'}" /> - <filter string="Mois" name="group_month" domain="[]" context="{'group_by' : 'date'}" /> - </group> - </search> - </field> - </record> + <!-- Filtres et Champ de Recherche --> + <record id="training_session_search" model="ir.ui.view"> + <field name="name">Training session Search View</field> + <field name="model">training.session</field> + <field name="arch" type="xml"> + <search> + <!-- Champs de recherche --> + <field name="session_id" /> + <field name="user_id" /> + <field name="training_id" /> + <!-- Filtres --> + <!-- Groupes --> + <group expand="0" name="group_by" string="Group By"> + <filter + string="Formateur" + name="group_user" + domain="[]" + context="{'group_by' : 'user_id'}" + /> + <filter + string="Formation" + name="group_training" + domain="[]" + context="{'group_by' : 'training_id'}" + /> + <filter + string="Mois" + name="group_month" + domain="[]" + context="{'group_by' : 'date'}" + /> + </group> + </search> + </field> + </record> - <record model="ir.actions.act_window" id="action_training_session"> - <field name="name">Sessions</field> - <field name="res_model">training.session</field> - <field name="view_mode">tree,form,calendar,pivot,graph</field> - </record> + <record model="ir.actions.act_window" id="action_training_session"> + <field name="name">Sessions</field> + <field name="res_model">training.session</field> + <field name="view_mode">tree,form,calendar,pivot,graph</field> + </record> - <!-- MENU --> - <menuitem id="menu_training_session" name="Sessions" sequence="20" parent="menu_training_training_parent" action="action_training_session" /> + <!-- MENU --> + <menuitem + id="menu_training_session" + name="Sessions" + sequence="20" + parent="menu_training_training_parent" + action="action_training_session" + /> - </data> </odoo> diff --git a/views/training_training_view.xml b/views/training_training_view.xml index b4f33f554a6b1f91f6e8c188736d5782c9ff02c1..1ddf06b9867c26ec6437db6af144a7bd6a47310c 100644 --- a/views/training_training_view.xml +++ b/views/training_training_view.xml @@ -1,170 +1,248 @@ -<?xml version="1.0" encoding="utf-8"?> - -<odoo> - <data> - <record id="training_training_form" model="ir.ui.view"> - <field name="name">Training Form View</field> - <field name="model">training.training</field> - <field name="arch" type="xml"> - <form string="Contrat"> - <header> - <button name="action_valid" states="draft" string="Valider" class="btn-primary" type="object" /> - <button name="action_done" states="current" string="Formation Terminée" class="btn-primary" type="object" /> - <button name="action_draft" states="current,done" string="Remettre en brouillon" class="" type="object" /> - <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,current,done"/> - </header> - <sheet> - <group> - <group string="Formation"> - <field name="customer_id" required="1"/> - <field name="course_id" required="1"/> - <field name="date_begin" widget="date" required="1"/> - <field name="date_end" widget="date" required="1"/> - <field name="students_nb_prev" required="1" placeholder="ex : 4, 4 à 6"/> - <field name="session_hours" required="1" placeholder="ex : 9h-12h ou 14h-17h"/> - </group> - <group string="OPCO"> - <field name="opco_id" /> - <field name="type" /> - <field name="payment" /> - <field name="file_number" /> - <field name="plan" /> - </group> - </group> - <group string="Infos Financières"> - <group> - <field name="cost" required="1"/> - <field name="rate" /> - <field name="amount" /> - <field name="invoiced" /> - </group> - <group> - <field name="students_count" /> - <field name="hours" /> - <field name="hours_total" /> - <field name="session_count" /> - </group> - </group> - <group> - <field name="place" required="1"/> - </group> - <notebook> - <page name="students" string="Stagiaires"> - <field name="student_ids" context="{'default_parent_id': customer_id, 'default_training_id': active_id}"> - <tree> - <field name="student_id" domain="[('parent_id', '=', parent_id), ]"/> - <field name="parent_id" /> - <field name="certificate" /> - </tree> - </field> - </page> - <page name="sessions" string="Sessions"> - <field name="session_ids"> - <tree editable="bottom"> - <field name="sequence" widget="handle"/> - <field name="session_id" /> - <field name="date" /> - <field name="user_id" /> - <field name="date_delay" /> - </tree> - </field> - </page> - <page name="convention" string="Convention"> - <group> - <field name="agreement_number" /> - <field name="date_convention" /> - <field name="convention" /> - </group> - </page> - <page name="attestation" string="Attestation"> - <group> - <field name="date_attestation" /> - </group> - </page> - <page name="orders" string="Commandes"> - <field name="order_ids" readonly="1" /> - </page> - <page name="invoices" string="Factures"> - <field name="invoice_ids" readonly="1" /> - </page> - </notebook> - </sheet> - <div class="oe_chatter"> - <field name="message_follower_ids" widget="mail_followers" /> - <field name="message_ids" widget="mail_thread" /> - </div> - </form> - </field> - </record> - - - <!-- Tree View Projects --> - <record id="training_training_tree" model="ir.ui.view"> - <field name="name">Training Tree View</field> - <field name="model">training.training</field> - <field name="arch" type="xml"> - <tree string="Liste des Formations"> - <field name="customer_id" /> - <field name="opco_id" /> - <field name="course_id" /> - <field name="date_begin" widget="date" /> - <field name="date_end" widget="date" /> - <field name="type" /> - <field name="amount" /> - <field name="invoiced" /> - <field name="payment" /> - <field name="state" /> - </tree> - </field> - </record> - - <!-- Filtres et Champ de Recherche --> - <record id="training_training_search" model="ir.ui.view"> - <field name="name">Training Search View</field> - <field name="model">training.training</field> - <field name="arch" type="xml"> - <search> - <!-- Champs de recherche --> - <field name="customer_id"/> - <field name="opco_id"/> - <field name="course_id"/> - <!-- Filtres --> - <filter string="Brouillon" name="filter_draft" domain="[('state','=','draft')]"/> - <filter string="En cours" name="filter_current" domain="[('state','=','current')]"/> - <filter string="Réalisé" name="filter_done" domain="[('state','=','done')]"/> - <separator></separator> - <filter string="INTRA" name="filter_intra" domain="[('type','=','intra')]"/> - <filter string="INTER" name="filter_inter" domain="[('type','=','inter')]"/> - <!-- Groupes --> - <group expand="0" name="group_by" string="Group By"> - <filter string="Client" name="group_customer" domain="[]" context="{'group_by' : 'customer_id'}" /> - <filter string="OPCO" name="group_opco" domain="[]" context="{'group_by' : 'opco_id'}" /> - <filter string="Formation" name="group_course" domain="[]" context="{'group_by' : 'course_id'}" /> - <separator></separator> - <filter string="Date Début" name="group_start" domain="[]" context="{'group_by' : 'date_begin'}" /> - <filter string="Date Fin" name="group_end" domain="[]" context="{'group_by' : 'date_end'}" /> - </group> - </search> - </field> - </record> - - <!-- ACTIONS --> - <record model="ir.actions.act_window" id="action_training_training"> - <field name="name">Formations</field> - <field name="res_model">training.training</field> - <field name="view_mode">tree,form,pivot,graph</field> - </record> - - <record model="ir.actions.act_window" id="action_training_session"> - <field name="name">Sessions</field> - <field name="res_model">training.session</field> - <field name="view_mode">tree,form,calendar,pivot,graph</field> - </record> - - <!-- MENU --> - <menuitem id="menu_training_training_parent" name="Gestion" sequence="1" parent="menu_training" /> - <menuitem id="menu_training_training" name="Formations" sequence="1" parent="menu_training_training_parent" action="action_training_training" /> - <menuitem id="menu_training_session" name="Sessions" sequence="20" parent="menu_training_training_parent" action="action_training_session" /> - - </data> -</odoo> +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright 2019-2022 Le Filament (<https://le-filament.com>) + License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> +<odoo> + <record id="training_training_form" model="ir.ui.view"> + <field name="name">Training Form View</field> + <field name="model">training.training</field> + <field name="arch" type="xml"> + <form string="Contrat"> + <header> + <button + name="action_valid" + states="draft" + string="Valider" + class="btn-primary" + type="object" + /> + <button + name="action_done" + states="current" + string="Formation Terminée" + class="btn-primary" + type="object" + /> + <button + name="action_draft" + states="current,done" + string="Remettre en brouillon" + class="" + type="object" + /> + <field + name="state" + widget="statusbar" + nolabel="1" + statusbar_visible="draft,current,done" + /> + </header> + <sheet> + <group> + <group string="Formation"> + <field name="customer_id" required="1" /> + <field name="course_id" required="1" /> + <field name="date_begin" widget="date" required="1" /> + <field name="date_end" widget="date" required="1" /> + <field name="students_nb_prev" required="1" placeholder="ex : 4, 4 à 6" /> + <field + name="session_hours" + required="1" + placeholder="ex : 9h-12h ou 14h-17h" + /> + </group> + <group string="OPCO"> + <field name="opco_id" /> + <field name="type" /> + <field name="payment" /> + <field name="file_number" /> + <field name="plan" /> + </group> + </group> + <group string="Infos Financières"> + <group> + <field name="cost" required="1" /> + <field name="rate" /> + <field name="amount" /> + <field name="invoiced" /> + </group> + <group> + <field name="students_count" /> + <field name="hours" /> + <field name="hours_total" /> + <field name="session_count" /> + </group> + </group> + <group> + <field name="place" required="1" /> + </group> + <notebook> + <page name="students" string="Stagiaires"> + <field + name="student_ids" + context="{'default_parent_id': customer_id, 'default_training_id': active_id}" + > + <tree> + <field name="student_id" domain="[('parent_id', '=', parent_id), ]" /> + <field name="parent_id" /> + <field name="certificate" /> + </tree> + </field> + </page> + <page name="sessions" string="Sessions"> + <field name="session_ids"> + <tree editable="bottom"> + <field name="sequence" widget="handle" /> + <field name="session_id" /> + <field name="date" /> + <field name="user_id" /> + <field name="date_delay" /> + </tree> + </field> + </page> + <page name="convention" string="Convention"> + <group> + <field name="agreement_number" /> + <field name="date_convention" /> + <field name="convention" /> + </group> + </page> + <page name="attestation" string="Attestation"> + <group> + <field name="date_attestation" /> + </group> + </page> + <page name="orders" string="Commandes"> + <field name="order_ids" readonly="1" /> + </page> + <page name="invoices" string="Factures"> + <field name="invoice_ids" readonly="1" /> + </page> + </notebook> + </sheet> + <div class="oe_chatter"> + <field name="message_follower_ids" widget="mail_followers" /> + <field name="message_ids" widget="mail_thread" /> + </div> + </form> + </field> + </record> + + + <!-- Tree View Projects --> + <record id="training_training_tree" model="ir.ui.view"> + <field name="name">Training Tree View</field> + <field name="model">training.training</field> + <field name="arch" type="xml"> + <tree> + <field name="customer_id" /> + <field name="opco_id" /> + <field name="course_id" /> + <field name="date_begin" widget="date" /> + <field name="date_end" widget="date" /> + <field name="type" /> + <field name="amount" /> + <field name="invoiced" /> + <field name="payment" /> + <field name="state" /> + </tree> + </field> + </record> + + <!-- Filtres et Champ de Recherche --> + <record id="training_training_search" model="ir.ui.view"> + <field name="name">Training Search View</field> + <field name="model">training.training</field> + <field name="arch" type="xml"> + <search> + <!-- Champs de recherche --> + <field name="customer_id" /> + <field name="opco_id" /> + <field name="course_id" /> + <!-- Filtres --> + <filter + string="Brouillon" + name="filter_draft" + domain="[('state','=','draft')]" + /> + <filter + string="En cours" + name="filter_current" + domain="[('state','=','current')]" + /> + <filter + string="Réalisé" + name="filter_done" + domain="[('state','=','done')]" + /> + <separator /> + <filter + string="INTRA" + name="filter_intra" + domain="[('type','=','intra')]" + /> + <filter + string="INTER" + name="filter_inter" + domain="[('type','=','inter')]" + /> + <!-- Groupes --> + <group expand="0" name="group_by" string="Group By"> + <filter + string="Client" + name="group_customer" + domain="[]" + context="{'group_by' : 'customer_id'}" + /> + <filter + string="OPCO" + name="group_opco" + domain="[]" + context="{'group_by' : 'opco_id'}" + /> + <filter + string="Formation" + name="group_course" + domain="[]" + context="{'group_by' : 'course_id'}" + /> + <separator /> + <filter + string="Date Début" + name="group_start" + domain="[]" + context="{'group_by' : 'date_begin'}" + /> + <filter + string="Date Fin" + name="group_end" + domain="[]" + context="{'group_by' : 'date_end'}" + /> + </group> + </search> + </field> + </record> + + <!-- ACTIONS --> + <record model="ir.actions.act_window" id="action_training_training"> + <field name="name">Formations</field> + <field name="res_model">training.training</field> + <field name="view_mode">tree,form,pivot,graph</field> + </record> + + <!-- MENU --> + <menuitem + id="menu_training_training_parent" + name="Gestion" + sequence="1" + parent="menu_training" + /> + <menuitem + id="menu_training_training" + name="Formations" + sequence="1" + parent="menu_training_training_parent" + action="action_training_training" + /> + +</odoo>