add modules elearning

This commit is contained in:
XuanHuyen
2025-04-28 16:35:45 +07:00
parent 480b7fdae3
commit 4f8478d1e7
319 changed files with 2910 additions and 0 deletions
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!--Inherit view certification modern to change font-->
<template id="certification_report_view_general_inherit" inherit_id="survey.certification_report_view_general">
<xpath expr="//div[@class='certification-top']/h1" position="replace">
<t t-if="layout_template == 'bhs'">
<h1>Certificate</h1>
<br/>
<h2 class="certification-name pt-1" t-if="user_input.scoring_success" t-field="user_input.survey_id.display_name"/>
</t>
<t t-else="">
<h1><b>Certificate</b>
<br/><span t-if="user_input.scoring_success">of achievement</span>
</h1>
</t>
</xpath>
<xpath expr="//div[hasclass('certification-content')]//div[@t-if='user_input.scoring_success']//p" position="replace">
<t t-if="layout_template == 'bhs'">
<p> <span style="font-size: 16pt;font-family: poppins-regular;padding-top:5pt;">This is to certify that</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="certified_name.isupper()">
<t t-set="certif_style" t-value="certif_style + 'font-family: greatvibes-regular;'"/>
</t>
<t t-elif="len(certified_name) > 20">
<t t-set="certif_style" t-value="certif_style + 'font-size: 40px; line-height: 4; color: #D5AE3A;'"/>
</t>
<span t-att-style="certif_style" class="user-name" t-out="certified_name">DEMO_CERTIFIED_NAME</span>
<p class="sub-content">
has successfully completed the course
<span class="certification-type" t-field="user_input.survey_id.display_name"/>
offered by <span t-field="user_input.env.company.display_name"/>. The course was
completed on <span t-field="user_input.create_date" t-options='{"widget": "date"}'/>.
Throughout the duration of the course, <span t-out="certified_name"/>
demonstrated dedication and a strong commitment to their studies, resulting in
a successful completion. <span t-out="certified_name"/>'s
engagement and active participation in the course activities were commendable.
</p>
</p>
</t>
<t t-else="">
<p> <span>This certificate is presented to</span>
<br/>
<t t-set="certif_style" t-value="'font-family: Lobster;'"/>
<t t-set="certified_name" t-value="user_input.partner_id.name or user_input.email or ''"/>
<t t-if="certified_name.isupper()">
<t t-set="certif_style" t-value="certif_style + 'font-family: certification-serif;'"/>
</t>
<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="len(certified_name) > 20">
<t t-if="layout_template == 'modern'">
<t t-set="certif_style" t-value="certif_style + 'font-size: 40px; line-height: 4;'"/>
</t>
<t t-else="">
<t t-set="certif_style" t-value="certif_style + 'font-size: 30px; line-height: 4;'"/>
</t>
</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.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>
</t>
</xpath>
</template>
</data>
</odoo>
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- QWeb Reports -->
<record id="bhs_certification_report" model="ir.actions.report">
<field name="name">BHS-Certifications</field>
<field name="model">survey.user_input</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">bhs_elearning_certification_template.bhs_certification_report_view</field>
<field name="report_file">bhs_elearning_certification_template.bhs_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="survey.model_survey_user_input"/>
<field name="binding_type">report</field>
<field name="paperformat_id" ref="survey.paperformat_survey_certification"/>
</record>
</data>
</odoo>