Files
odoo_source/addons/gamification/report/report_progress.xml
T

82 lines
2.8 KiB
XML

<?xml version="1.0" ?>
<openerp>
<data>
<!--Email template for individual report -->
<record id="email_template_gamification_individual" model="email.template">
<field name="name">Individual Goal Report - Send by Email</field>
<field name="email_from">noreply@localhost</field>
<field name="subject">Individual report - ${object.name}</field>
<field name="email_recipients">${object.report_message_group_id.alias_id.name_get()[0][1]}</field>
<field name="model_id" ref="gamification.model_gamification_goal_plan"/>
<field name="auto_delete" eval="True"/>
<field name="body_html"><![CDATA[
<div>
<h1>Individual report - ${object.name}</h1>
<p>Hello, bellow are the latest results for the plan ${object.name} for ${ctx['user'].name}.</p>
<table width="100%" border="1">
<tr>
<th>Goal</th>
<th>Target</th>
<th>Current</th>
<th>Completeness</th>
</tr>
% for goal in ctx['goals']:
<tr>
<td>${goal.type_id.name}</td>
<td>${goal.target_goal}</td>
<td>${goal.current}</td>
<td>${goal.completeness} %</td>
</tr>
% endfor
</table>
</div>
]]></field>
</record>
<!-- Email template for leaderboard -->
<record id="email_template_gamification_leaderboard" model="email.template">
<field name="name">Leaderboard Goal Report - Send by Email</field>
<field name="email_from">noreply@localhost</field>
<field name="subject">${object.name} group report</field>
<field name="email_recipients">${object.report_message_group_id.alias_id.name_get()[0][1]}</field>
<field name="model_id" ref="gamification.model_gamification_goal_plan"/>
<field name="auto_delete" eval="True"/>
<field name="body_html"><![CDATA[
<div>
<h1>Group report - ${object.name}</h1>
<p>Hello,
Bellow are the latest results for the plan ${object.name} for the group ${object.report_message_group_id.name}</p>
% for planline in ctx['planlines']:
<h2>${planline['goal_type']}</h2>
<table width="100%" border="1">
<th>#</th>
<th>User</th>
<th>Completeness</th>
<th>Current</th>
% for idx, goal in planline['list']:
<tr
% if goal.completeness >= 100:
style="font-weight:bold;""
% endif
>
<td>${idx+1}</td>
<td>${goal.user.name}</td>
<td>${goal.completeness}%</td>
<td>${goal.current}/${goal.target_goal}</td>
</tr>
% endfor
</table>
% endfor
</div>
]]></field>
</record>
</data>
</openerp>