diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 732d0c4a644eb444d6b4385643ff32fab19fab52..d9628ce62663a69063a34a25dcb08bb3aa74cf9a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,6 +6,8 @@ exclude: | ^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 @@ -25,8 +27,13 @@ repos: entry: found forbidden files; remove them language: fail files: "\\.rej$" + - id: en-po-files + name: en.po files cannot exist + entry: found a en.po file + language: fail + files: '[a-zA-Z0-9_]*/i18n/en\.po$' - repo: https://github.com/oca/maintainer-tools - rev: 7d8a9f9ad73db0976fb03cbee43d953bc29b89e9 + rev: ab1d7f6 hooks: # update the NOT INSTALLABLE ADDONS section above - id: oca-update-pre-commit-excluded-addons @@ -48,10 +55,11 @@ repos: hooks: - id: black - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.6.2 + rev: v2.1.2 hooks: - id: prettier name: prettier (with plugin-xml) + exclude: ^templates/ additional_dependencies: - "prettier@2.1.2" - "@prettier/plugin-xml@0.12.0" @@ -59,7 +67,7 @@ repos: - --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: v8.15.0 + rev: v7.8.1 hooks: - id: eslint verbose: true @@ -67,7 +75,7 @@ repos: - --color - --fix - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v3.2.0 hooks: - id: trailing-whitespace # exclude autogenerated files @@ -89,37 +97,33 @@ repos: - id: mixed-line-ending args: ["--fix=lf"] - repo: https://github.com/asottile/pyupgrade - rev: v2.32.1 + rev: v2.7.2 hooks: - id: pyupgrade args: ["--keep-percent-format"] - repo: https://github.com/PyCQA/isort - rev: 5.10.1 + rev: 5.12.0 hooks: - id: isort name: isort except __init__.py args: - --settings=. exclude: /__init__\.py$ - - repo: https://gitlab.com/PyCQA/flake8 - rev: 3.9.2 + - repo: https://github.com/PyCQA/flake8 + rev: 3.8.3 hooks: - id: flake8 name: flake8 additional_dependencies: ["flake8-bugbear==20.1.4"] - - repo: https://github.com/PyCQA/pylint - rev: v2.11.1 + - repo: https://github.com/OCA/pylint-odoo + rev: 7.0.2 hooks: - - id: pylint + - id: pylint_odoo name: pylint with optional checks args: - --rcfile=.pylintrc - --exit-zero verbose: true - additional_dependencies: &pylint_deps - - pylint-odoo==5.0.5 - - id: pylint - name: pylint with mandatory checks + - id: pylint_odoo args: - --rcfile=.pylintrc-mandatory - additional_dependencies: *pylint_deps diff --git a/models/scop_cotisation_cg_exo.py b/models/scop_cotisation_cg_exo.py index 0172cb289eb80fe6a97c27bb5ca43e445c92aa0e..dc1e237b6f3dbb111e893e6ab37a8f40f062e477 100644 --- a/models/scop_cotisation_cg_exo.py +++ b/models/scop_cotisation_cg_exo.py @@ -109,7 +109,7 @@ class ScopCotisationExo(models.Model): amount_quarter = fields.Float("Montant souhaité pour les échéances") percent_quarter = fields.Integer("Réduction appliquée aux échéances") date_exo_ok = fields.Date("Date Acceptation Exo") - head_office_comment = fields.Text("Commentaire") + head_office_comment = fields.Text("Commentaire courrier adhérent") note = fields.Text("Notes internes") instance_id = fields.Many2one(comodel_name="scop.instance", string="Instance") bordereau_ids = fields.Many2many( @@ -277,9 +277,7 @@ class ScopCotisationExo(models.Model): { "exo_id": self.id, "contribution_id": contrib.id, - "amount": round( - self.amount_quarter / len(contrib_type), 2 - ), + "amount": round(self.amount_quarter / len(contrib_type), 2), } ) else: diff --git a/security/security_rules.xml b/security/security_rules.xml index 6bd7c5659597de38c5285b4523323efd39bb922a..bc2c42f5e2cdbd39ea3650080f3491be7cbdcd46 100644 --- a/security/security_rules.xml +++ b/security/security_rules.xml @@ -3,7 +3,9 @@ <data noupdate="1"> <record id="cotisation_exo_user_rule" model="ir.rule"> - <field name="name">CG Scop - Cotisation - Exonérations multi-company user</field> + <field + name="name" + >CG Scop - Cotisation - Exonérations multi-company user</field> <field name="model_id" ref="model_scop_cotisation_cg_exo" /> <field name="groups" eval="[(6, 0, [ref('base.group_user')])]" /> <field @@ -11,10 +13,15 @@ >['|',('partner_id.ur_id','=',False),('partner_id.ur_id','=',user.ur_id.id)]</field> </record> <record id="cotisation_exo_admin_rule" model="ir.rule"> - <field name="name">CG Scop - Cotisation - Exonérations multi-company admin</field> + <field + name="name" + >CG Scop - Cotisation - Exonérations multi-company admin</field> <field name="model_id" ref="model_scop_cotisation_cg_exo" /> <field name="domain_force">[(1,'=',1)]</field> - <field name="groups" eval="[(6, 0, [ref('cgscop_partner.group_cg_administrative')])]" /> + <field + name="groups" + eval="[(6, 0, [ref('cgscop_partner.group_cg_administrative')])]" + /> </record> </data> </odoo> diff --git a/templates/report_scop_exo.xml b/templates/report_scop_exo.xml index e7623c878c7dc48f4d79cdd38cd9f145925a77fe..c9ff18397837a7d7c6e36d3d12b3a6fc7a046f42 100644 --- a/templates/report_scop_exo.xml +++ b/templates/report_scop_exo.xml @@ -9,116 +9,93 @@ <div class="row"> <div class="col-6 offset-6 oe_mt64 oe_mb64"> - <span - t-field="o.partner_id.name" - style="text-transform: uppercase; font-weight: 600;" - /><br /> - <span t-field="o.partner_id.street" /><br /> - <t t-if="o.partner_id.street2"><span - t-field="o.partner_id.street2" - /><br /></t> - <t t-if="o.partner_id.street3"><span - t-field="o.partner_id.street3" - /><br /></t> - <span t-field="o.partner_id.zip" /> <span - t-field="o.partner_id.city" - style="text-transform: uppercase;" - /> - <t t-if="o.partner_id.cedex"> <span - t-field="o.partner_id.cedex" - /></t> - </div> - </div> - <div class="row"> - <div class="col-12 text-center oe_mb32"> - <h2 style="color: #E5074D;"> - Demande d'exonération de cotisations - </h2> + <span t-field="o.partner_id.name" style="text-transform: uppercase; font-weight: 600;" /> + <br /> + <span t-field="o.partner_id.street" /> + <br /> + <t t-if="o.partner_id.street2"> + <span t-field="o.partner_id.street2" /> + <br /> + </t> + <t t-if="o.partner_id.street3"> + <span t-field="o.partner_id.street3" /> + <br /> + </t> + <span t-field="o.partner_id.zip" /> <span t-field="o.partner_id.city" style="text-transform: uppercase;" /> + <t t-if="o.partner_id.cedex"> + <span t-field="o.partner_id.cedex" /> + </t> </div> </div> <div class="row"> <div class="col-12 oe_mb32"> <p> - Paris, le <span - t-esc="o.date_exo_ok" - t-options="{'widget': 'date', 'format': 'd MMMM YYYY'}" - /> + Paris, le <span t-esc="o.date_exo_ok" t-options="{'widget': 'date', 'format': 'dd/MM/YYYY'}" /> </p> <p> - N° adhérent : <t - t-esc="str(o.partner_id.member_number_int)" - /><br /> + Objet : Demande d'exonération de cotisations + <br /> + N° adhérent : <t t-esc="str(o.partner_id.member_number_int)" /> + <br /> N° exonération : <span t-esc="o.number" /> </p> + <p>Copie : <t t-esc="o.partner_id.ur_id.name" /></p> </div> </div> <div class="row oe_mb16"> <div class="col-12" style="test-align: justify;"> - <p class="oe_mb32">Cher Coopérateur,</p> + <p class="oe_mb32">Chère Coopératrice, Cher Coopérateur,</p> <!-- Avis Favorable--> <t t-if="o.final_notice == 'favorable'"> - <p - >Pour faire suite à votre dernier courrier, Le Bureau de la Direction Nationale qui s’est réuni le<span - t-esc="o.instance_id.date" - t-options="{'widget': 'date', 'format': 'd MMMM YYYY'}" - /> a décidé de vous accorder une exonération exceptionnelle de vos cotisations confédérales.</p> <p> - Le Bureau prend donc acte des modalités suivantes : + Pour faire suite à votre dernier courrier, Le Bureau de la Direction Nationale qui s’est réuni le <span t-esc="o.instance_id.date" t-options="{'widget': 'date', 'format': 'dd/MM/YYYY'}" />, a décidé de vous accorder une exonération exceptionnelle de vos cotisations confédérales. + </p> + <p> + Le Bureau a acté les modalités suivantes : </p> - <p style="padding: 15px;"> + <p> <!-- Exonération totale--> - <t - t-if="(o.type_exo == 'percent' and o.percent_quarter == 100) or (o.type_exo == 'amount' and o.amount_quarter == 0)" - > + <t t-if="(o.type_exo == 'percent' and o.percent_quarter == 100) or (o.type_exo == 'amount' and o.amount_quarter == 0)"> Exonération totale des cotisations pour la période du </t> <t t-else=""> <!-- Réduction des échéances--> <t t-if="o.type_exo == 'percent'"> - Exonération de <span - t-field="o.percent_quarter" - />% du montant des échéances trimestrielles sur la période du + Exonération de <span t-field="o.percent_quarter" />% du montant des échéances trimestrielles sur la période du </t> <!-- Montant fixe des échéances--> <t t-if="o.type_exo == 'amount'"> - Un montant des prochaines échéances fixé à <span - t-field="o.amount_quarter" - />€ pour la période du + Un montant des prochaines échéances fixé à <span t-field="o.amount_quarter" t-options="{'widget': 'monetary', 'display_currency': o.partner_id.currency_id}" /> pour la période du </t> </t> <strong> - <t t-if="o.nb_quarter == 1"><span - t-field="o.quarter_exo_start" - /> <span t-field="o.year_exo_start" />.</t> + <t t-if="o.nb_quarter == 1"> + <span t-field="o.quarter_exo_start" /> <span t-field="o.year_exo_start" /> + </t> <t t-else=""> - <span t-field="o.quarter_exo_start" /> <span - t-field="o.year_exo_start" - /> au <span - t-field="o.quarter_exo_end" - /> <span t-field="o.year_exo_end" />. + <span t-field="o.quarter_exo_start" /> <span t-field="o.year_exo_start" /> au <span t-field="o.quarter_exo_end" /> <span t-field="o.year_exo_end" /> </t> + (du <span t-field="o.date_exo_start" /> au <span t-field="o.date_exo_end" /> inclus). </strong> </p> + <p t-if="o.head_office_comment"> + <t t-esc="o.head_office_comment" /> + </p> </t> <!-- Avis Défavorable--> <t t-if="o.final_notice == 'unfavorable'"> - <p - >Pour faire suite à votre dernier courrier, Le Bureau de la Direction Nationale qui s’est réuni le<span - t-esc="o.instance_id.date" - t-options="{'widget': 'date', 'format': 'd MMMM YYYY'}" - /> a décidé de ne pas accorder d'exonération exceptionnelle de vos cotisations confédérales pour la raison suivante : </p> + <p> + Pour faire suite à votre dernier courrier, Le Bureau de la Direction Nationale qui s’est réuni le<span t-esc="o.instance_id.date" t-options="{'widget': 'date', 'format': 'd MMMM YYYY'}" /> a décidé de ne pas accorder d'exonération exceptionnelle de vos cotisations confédérales pour la raison suivante : + </p> <p> <t t-esc="o.head_office_comment" /> </p> </t> - - <p - >Je vous prie de croire, cher Coopérateur, en l’assurance de toute ma considération coopérative.</p> - <p>Le Président</p> - <p>Jacques LANDRIOT</p> - <p>Copie : <t t-esc="o.partner_id.ur_id.name" /></p> + <p>Je vous prie de croire, Chère Coopératrice, Cher Coopérateur, en l’assurance de toute ma considération coopérative.</p> + <p></p> + <p style="margin-top: 120px;">Le Président, Jacques LANDRIOT</p> </div> </div> </div> @@ -129,10 +106,7 @@ <t t-call="web.html_container"> <t t-set="docs" t-value="docs.with_context(lang='fr')" /> <t t-foreach="docs" t-as="o"> - <t - t-call="cgscop_cotisation_cg_exo.report_exo_coop_document" - t-lang="fr" - /> + <t t-call="cgscop_cotisation_cg_exo.report_exo_coop_document" t-lang="fr" /> </t> </t> </template>