19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:30:27 +01:00
parent d1963a3c3a
commit 2d3ee4855a
7430 changed files with 2687981 additions and 2965473 deletions

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Paper Format -->
<record id="paperformat_survey_certification" model="report.paperformat">
<field name="name">Survey Certification</field>
<field name="default" eval="True"/>
<field name="format">A4</field>
<field name="orientation">Landscape</field>
<field name="margin_top">0</field>
<field name="margin_bottom">0</field>
<field name="margin_left">0</field>
<field name="margin_right">0</field>
<field name="header_line" eval="False"/>
<field name="header_spacing">0</field>
<field name="disable_shrinking" eval="True"/>
<field name="dpi">96</field>
</record>
<!-- QWeb Reports -->
<record id="certification_report" model="ir.actions.report">
<field name="name">Certifications</field>
<field name="model">survey.user_input</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">survey.certification_report_view</field>
<field name="report_file">survey.certification_report_view</field>
<field name="print_report_name">'Certification - %s' % (object.survey_id.display_name)</field>
<field name="attachment">'certification.pdf'</field>
<field name="binding_model_id" ref="model_survey_user_input"/>
<field name="binding_type">report</field>
<field name="paperformat_id" ref="paperformat_survey_certification"/>
</record>
</data>
</odoo>

View file

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="certification_report_view_general">
<!-- Style classes to be applied to '#o_survey_certification': [no class](purple), gold, blue -->
<div id="o_survey_certification" t-att-data-oe-model="user_input._name" t-att-data-oe-id="user_input.id"
t-attf-class="#{'article certification-wrapper ' + layout_template + ' ' + layout_color}">
<div class="certification">
<div class="certification-seal" t-if="user_input.scoring_success and layout_template == 'modern'"/>
<div class="certification-top">
<h1><b>Certificate</b>
<br/><span t-if="user_input.scoring_success">of achievement</span>
</h1>
</div>
<div class="page certification-content">
<div class="oe_structure"/>
<div t-if="user_input.scoring_success">
<div class="oe_structure"/>
<p> <span>This certificate is presented to</span>
<br/>
<t t-set="certif_style" t-value="''"/>
<t t-set="certified_name" t-value="user_input.partner_id.name or user_input.email or ''"/>
<t t-if="len(certified_name) > 35 and layout_template == 'classic'">
<t t-set="certif_style" t-value="certif_style + 'font-size: 20px; line-height: 4; font-family: certification-serif;'"/>
</t>
<t t-elif="layout_template == 'modern'">
<t t-if="len(certified_name) > 45">
<t t-set="certif_style" t-value="certif_style + 'font-size: 20px; line-height: 4;'"/>
</t>
<t t-elif="len(certified_name) > 35">
<t t-set="certif_style" t-value="certif_style + 'font-size: 30px; line-height: 4;'"/>
</t>
<t t-elif="len(certified_name) > 20">
<t t-set="certif_style" t-value="certif_style + 'font-size: 40px; line-height: 4;'"/>
</t>
</t>
<t t-else="">
<t t-set="certif_style" t-value="certif_style + 'font-size: 30px; line-height: 4;'"/>
</t>
<span t-att-style="certif_style" class="user-name" t-out="certified_name">DEMO_CERTIFIED_NAME</span>
<br/> <span>by</span> <span class="certification-company" t-field="user_input.create_uid.sudo().company_id.display_name">Odoo</span> <span>for successfully completing</span>
<br/><b><span class="certification-name" t-field="user_input.survey_id.display_name">Functional Training</span></b>
</p>
<div class="oe_structure"/>
</div>
<div t-else="" class="certification-failed">
<p>Certification Failed</p>
<div class="oe_structure"/>
</div>
<div class="oe_structure"/>
</div>
<div class="certification-bottom">
<div class="oe_structure"/>
<div class="certification-date-wrapper">
<span class="certification-date" t-field="user_input.create_date" t-options='{"widget": "date"}'>2023-08-18</span>
<span>Date</span>
</div>
<div class="certification-company">
<span class="certification-company-logo" t-field="user_input.create_uid.sudo().company_id.logo" t-options="{'widget': 'image'}" role="img"/>
</div>
</div>
<div t-if="user_input.test_entry" class="test-entry"/>
<div class="certification-number" t-if="user_input.scoring_success">
Certification n°<span t-out="str(user_input.id).rjust(10, '0')">0000000010</span>
</div>
</div>
</div>
</template>
<template id="certification_report_view">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="user_input">
<t t-set="layout_values" t-value="user_input.survey_id.certification_report_layout.split('_') if user_input.survey_id.certification_report_layout else ['modern', 'purple']"/>
<t t-set="layout_template" t-value="layout_values[0]"/>
<t t-set="layout_color" t-value="layout_values[1]"/>
<t t-call="survey.certification_report_view_general"/>
</t>
</t>
</template>
</data>
</odoo>