summaryrefslogtreecommitdiff
path: root/addons/gamification/data
diff options
context:
space:
mode:
authorMartin Trigaux <mat@openerp.com>2013-12-24 15:45:14 +0100
committerMartin Trigaux <mat@openerp.com>2013-12-24 15:45:14 +0100
commitbe7bc54edc2fcc0abb94450d22f37ae4d4b11dce (patch)
tree6b54c5e5d42e3de27b3d8fedb272df00240c8a2c /addons/gamification/data
parent25117ca97f0bc61b27a407f48b97136151fe8303 (diff)
[REF] gamification: use m2o to email.template for report progress, create new field report_template_id, cleaning code
bzr revid: mat@openerp.com-20131224144514-lmbhw88nj7aa3r8i
Diffstat (limited to 'addons/gamification/data')
-rw-r--r--addons/gamification/data/__init__.py22
-rw-r--r--addons/gamification/data/goal_base.xml34
-rw-r--r--addons/gamification/data/goal_definition.py32
3 files changed, 13 insertions, 75 deletions
diff --git a/addons/gamification/data/__init__.py b/addons/gamification/data/__init__.py
deleted file mode 100644
index b5649616b2c..00000000000
--- a/addons/gamification/data/__init__.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import goal_definition
diff --git a/addons/gamification/data/goal_base.xml b/addons/gamification/data/goal_base.xml
index 5da7b86679d..7c23ae81020 100644
--- a/addons/gamification/data/goal_base.xml
+++ b/addons/gamification/data/goal_base.xml
@@ -122,23 +122,22 @@
<header>
<strong>Reminder ${object.name}</strong>
</header>
-
- <p class="oe_grey">${object.report_header or ''}</p>
<p>You have not updated your progress for the goal ${object.definition_id.name} (currently reached at ${object.completeness}%) for at least ${object.remind_update_delay} days. Do not forget to do it.</p>
<p>If you have not changed your score yet, you can use the button "The current value is up to date" to indicate so.</p>
]]></field>
</record>
-
- <record id="email_template_goal_progress_perso" model="email.template">
- <field name="name">Personal Goal Progress</field>
+
+ <record id="simple_report_template" model="email.template">
+ <field name="name">Simple Challenge Report Progress</field>
<field name="body_html"><![CDATA[
- <header>
- <strong>${object.name}</strong>
- </header>
- <p class="oe_grey">${object.report_header or ''}</p>
+<header>
+ <strong>${object.name}</strong>
+</header>
+<p class="oe_grey">The following message contains the current progress for the challenge ${object.name}</p>
+% if object.visibility_mode == 'personal':
<table width="100%" border="1">
<tr>
<th>Goal</th>
@@ -166,17 +165,8 @@
<td>${line['completeness']} %</td>
</tr>
% endfor
- </table>]]></field>
- </record>
-
- <record id="email_template_goal_progress_group" model="email.template">
- <field name="name">Group Goal Progress</field>
- <field name="body_html"><![CDATA[
- <header>
- <strong>${object.name}</strong>
- </header>
- <p class="oe_grey">${object.report_header or ''}</p>
-
+ </table>
+% else:
% for line in ctx["challenge_lines"]:
<table width="100%" border="1">
<tr>
@@ -209,7 +199,9 @@
<br/><br/>
% endfor
-]]></field>
+% endif
+ ]]></field>
</record>
+
</data>
</openerp>
diff --git a/addons/gamification/data/goal_definition.py b/addons/gamification/data/goal_definition.py
deleted file mode 100644
index e16f2c7b11f..00000000000
--- a/addons/gamification/data/goal_definition.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>
-#
-##############################################################################
-
-from openerp.osv import osv
-
-
-class gamification_goal_definition_data(osv.Model):
- """Goal definition data
-
- Methods for more complex goals not possible with the 'sum' and 'count' mode.
- Each method should return the value that will be set in the 'current' field
- of a user's goal. The return definition must be a float or integer.
- """
- _inherit = 'gamification.goal.definition'