From cf01065d8c6dfd9fd0ef42f1cfd0459e256f9054 Mon Sep 17 00:00:00 2001 From: Benjamin <benjamin@le-filament.com> Date: Fri, 10 Jan 2020 00:25:10 +0100 Subject: [PATCH] Fix error template --- __manifest__.py | 1 - report/layout_template.xml | 45 ----------- report/report_agreement.xml | 126 +++++++++++++++-------------- report/report_attendance_sheet.xml | 43 +++++----- report/report_attestation.xml | 32 ++------ report/report_program.xml | 56 +++++++------ static/src/less/style.less | 5 +- views/assets.xml | 2 +- 8 files changed, 124 insertions(+), 186 deletions(-) delete mode 100644 report/layout_template.xml diff --git a/__manifest__.py b/__manifest__.py index 4f27151..27cac26 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -24,7 +24,6 @@ 'views/training_course_view.xml', 'views/training_training_view.xml', 'views/training_session_view.xml', - 'report/layout_template.xml', 'report/report_agreement.xml', 'report/report_attestation.xml', 'report/report_attendance_sheet.xml', diff --git a/report/layout_template.xml b/report/layout_template.xml deleted file mode 100644 index f49b362..0000000 --- a/report/layout_template.xml +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<odoo> - -<template id="training_layout_header"> - <div class="header"> - <div class="row"> - <div class="col-xs-12"> - <img src="/lefilament_training/static/src/img/logo-lefilament.png" style="max-width: 180px;"/> - </div> - </div> - </div> -</template> - -<template id="training_layout_footer"> - <div class="footer"> - <div class="row"> - <div class="col-xs-12 training-footer"> - <p><strong>LE FILAMENT</strong> – SCOP SARL à capital variable – 32 Rue Riquet, 31000 Toulouse<br/> - SIRET : 81500439500027 - Code APE : 6202A<br/> - RCS de TOULOUSE n°B 815 004 395 - TVA : FR 60815004395<br/> - « Organisme de Formation enregistré sous le numéro 73310810731. Cet enregistrement ne vaut pas agrément de l’État »</p> - <p>Page <span class="page"/>/<span class="topage"/></p> - </div> - </div> - </div> -</template> - -<template id="training_layout"> - <!-- Multicompany --> - <t t-if="not o and doc"> - <t t-set="o" t-value="doc"/> - </t> - <t t-if="o and 'company_id' in o"> - <t t-set="company" t-value="o.company_id"></t> - </t> - <t t-if="not o or not 'company_id' in o"> - <t t-set="company" t-value="res_company"></t> - </t> - - <!-- <t t-call="lefilament_training.training_layout_header" /> --> - <t t-raw="0" /> - <t t-call="lefilament_training.training_layout_footer" /> -</template> - -</odoo> diff --git a/report/report_agreement.xml b/report/report_agreement.xml index 52c1394..d31562c 100644 --- a/report/report_agreement.xml +++ b/report/report_agreement.xml @@ -5,35 +5,27 @@ <template id="qweb_agreement_pdf"> <t t-call="web.html_container"> <t t-foreach="docs" t-as="doc"> - <t t-call="lefilament_training.training_layout"> + <t t-call="web.external_layout"> <div class="page"> - <div class="row convention"> - <div class="col-xs-6"> - <img src="/lefilament_training/static/src/img/logo-lefilament.png" style="max-width: 180px;"/> + <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-xs-6 text-right" style="margin-top: 40px;"> - Le Filament<br/> - 32 Rue Riquet, 31000 Toulouse<br/> - OF n°73 31 081 07 31<br/> - </div> - <div class="col-xs-12" > - <div class="col-xs-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-xs-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> - + <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> + + <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> @@ -41,35 +33,38 @@ 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> - <tbody> - <tr> - <td style="width: 120px;">Lieu :</td> - <td><span t-field="doc.place" /></td> + <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: 120px;">Dates :</td> - <td>Du <span t-field="doc.date_begin" /> au <span t-field="doc.date_end" /></td> + <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> - <td style="width: 120px;">Durée :</td> - <td><span t-esc="doc.hours" />h</td> + <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-stiped table-condensed"> + <table class="table table-borderless table-sm"> <thead> <tr> <th>Intitulé</th> @@ -88,39 +83,50 @@ </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> - </div> - <div class="col-xs-4"> - Pour <span t-field="doc.customer_id.name" /> <br/> - (Cachet et signature) - </div> - <div class="col-xs-offset-4 col-xs-4"> - Pour LE FILAMENT <br/> - Benjamin RIVIER, Gérant<br/> - (Cachet et signature) + <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> @@ -131,16 +137,16 @@ </template> <record id="paperformat_a4_training" model="report.paperformat"> - <field name="name">A4 Sans Header</field> + <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">10</field> - <field name="margin_bottom">25</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">0</field> + <field name="header_spacing">30</field> <field name="dpi">90</field> </record> diff --git a/report/report_attendance_sheet.xml b/report/report_attendance_sheet.xml index ebc07b4..702d4a9 100644 --- a/report/report_attendance_sheet.xml +++ b/report/report_attendance_sheet.xml @@ -5,7 +5,7 @@ <template id="qweb_attendance_sheet_pdf"> <t t-call="web.html_container"> <t t-foreach="docs" t-as="doc"> - <t t-call="lefilament_training.training_layout"> + <t t-call="web.external_layout"> <!-- gestion du nombre de sessions par page = 8 --> <t t-set="nb_case" t-value="8" /> @@ -14,16 +14,9 @@ <div class="page"> <t t-foreach="nb_page" t-as="page"> <div class="row attendance"> - <div class="col-xs-12 content-pdf" > - <div class="col-xs-6"> - <img src="/lefilament_training/static/src/img/logo-lefilament.png" style="max-width: 180px;"/> - </div> - <div class="col-xs-6 text-right" style="margin-top: 40px;"> - Le Filament<br/> - 32 Rue Riquet, 31000 Toulouse<br/> - OF n°73 31 081 07 31<br/> - </div> - <div class="col-xs-12 text-center"> + <div class="col-12 content-pdf" > + + <div class="col-12 text-center"> <h1> FORMATION : <span t-field="doc.course_id.name" /> </h1> @@ -32,12 +25,12 @@ Feuille d'émargement </h2> </div> - <div class="col-xs-6"> + <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-xs-6"> + <div class="col-6"> <t t-if="doc.file_number"> <strong>N° Dossier : </strong><span t-field="doc.file_number" /><br/> </t> @@ -45,14 +38,14 @@ <strong>Dispositif : </strong><span t-field="doc.plan" /> </t> </div> - <div class="col-xs-12 mt16 mb16"> - <table class="table table-bordered"> + <div class="col-12 mt16 mb16"> + <table class="table table-bordered" > <thead> <tr> - <th style="vertical-align: middle; width: 100px;">Nom</th> - <th style="vertical-align: middle; width: 100px;">Prénom</th> + <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 style="vertical-align: middle; width: 100px;"> + <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 @@ -62,13 +55,13 @@ </thead> <tbody> <t t-set="length" t-value="nb_case + 2" /> - <tr class="active"> + <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;"> - <td style="vertical-align: middle;"><span t-field="student.student_id.lastname" /></td> - <td style="vertical-align: middle;"><span t-field="student.student_id.firstname" /></td> + <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> @@ -76,13 +69,13 @@ </tr> </t> <t t-set="trainers" t-value="doc._get_trainers()"/> - <tr class="active"> + <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;"> - <td style="vertical-align: middle;"><span t-field="trainer.lastname" /></td> - <td style="vertical-align: middle;"><span t-field="trainer.firstname" /></td> + <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> @@ -121,7 +114,7 @@ model="training.training" string="Formation - Feuille d'émargement" report_type="qweb-pdf" - paperformat="lefilament_training.paperformat_a4_training" + paperformat="paperformat_a4_training" attachment_use="False" /> diff --git a/report/report_attestation.xml b/report/report_attestation.xml index f6a34bc..5419358 100644 --- a/report/report_attestation.xml +++ b/report/report_attestation.xml @@ -6,22 +6,14 @@ <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="lefilament_training.training_layout"> + <t t-call="web.external_layout"> <div class="page"> <div class="row convention"> - <div class="col-xs-6"> - <img src="/lefilament_training/static/src/img/logo-lefilament.png" style="max-width: 180px;"/> - </div> - <div class="col-xs-6 text-right" style="margin-top: 40px;"> - Le Filament<br/> - 32 Rue Riquet, 31000 Toulouse<br/> - OF n°73 31 081 07 31<br/> - </div> - <div class="col-xs-12" > - <div class="col-xs-12 text-center"> + <div class="col-12" > + <div class="col-12 text-center"> <h1>ATTESTATION DE FIN DE FORMATION</h1> </div> - <div class="col-xs-12" style="margin-top: 20px;"> + <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> @@ -60,7 +52,7 @@ <h3>ACQUIS DE LA FORMATION</h3> <p t-field="doc.course_id.acquis" /> </div> - <div class="col-xs-offset-8 col-xs-4" style="margin-top: 20px;"> + <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> @@ -73,20 +65,6 @@ </t> </template> - <record id="paperformat_a4_training" model="report.paperformat"> - <field name="name">A4 Sans Header</field> - <field name="default" eval="True"/> - <field name="format">A4</field> - <field name="orientation">Portrait</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> - <report id="report_attestation_pdf" name="lefilament_training.qweb_attestation_pdf" model="training.training" diff --git a/report/report_program.xml b/report/report_program.xml index d23f81b..e544de9 100644 --- a/report/report_program.xml +++ b/report/report_program.xml @@ -5,61 +5,65 @@ <template id="qweb_program_pdf"> <t t-call="web.html_container"> <t t-foreach="docs" t-as="doc"> - <t t-call="lefilament_training.training_layout"> + <t t-call="web.external_layout"> <div class="page"> <div class="row convention"> - <div class="col-xs-6"> - <img src="/lefilament_training/static/src/img/logo-lefilament.png" style="max-width: 180px;"/> - </div> - <div class="col-xs-6 text-right" style="margin-top: 40px;"> - Le Filament<br/> - 32 Rue Riquet, 31000 Toulouse<br/> - OF n°73 31 081 07 31<br/> - </div> - <div class="col-xs-12" > - <div class="col-xs-12 text-center"> + <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="col-xs-12"> + <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="subblock"> <h3>3. PROGRAMME DE LA FORMATION</h3> <t t-foreach="doc.session_ids" t-as="session"> - <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> - </t> - + <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_count" /> personnes, et par session de demi-journées (4h), afin de s’adapter aux contraintes de disponibilité de l’entreprise.</p> <p>Horaires : <strong>9h-13h ou 13h-17h</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_count" /> personnes soit <span t-esc="doc.cost / doc.students_count" /> € par personne. + <span t-field="doc.cost" /> € HT en formation INTRA de <span t-field="doc.students_count" /> personnes soit <span t-esc="round(doc.cost / doc.students_count, 2)" /> € par personne. </p> - + </div> + <div class="subblock"> <h3>11. LES STAGIAIRES</h3> <span t-field="doc.course_id.students_profile" /> </div> diff --git a/static/src/less/style.less b/static/src/less/style.less index 2d0707b..48b03f1 100644 --- a/static/src/less/style.less +++ b/static/src/less/style.less @@ -49,7 +49,10 @@ body, table, td, span, div { font-family: inherit; } - .attendance {page-break-after: always;} +.attendance {page-break-after: always;} +.subblock { + page-break-inside: avoid; +} .attendance, .attendance td, .convention, .convention td { font-family: @typo_body; diff --git a/views/assets.xml b/views/assets.xml index 34d5e12..59882ac 100644 --- a/views/assets.xml +++ b/views/assets.xml @@ -9,7 +9,7 @@ </xpath> </template> - <template id="training_assets_common" name="training_assets" inherit_id="web.report_assets_common"> + <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/less/style.less"/> </xpath> -- GitLab