diff --git a/addons/gamification/__openerp__.py b/addons/gamification/__openerp__.py
index 5946e81224f..eb0ce297fa2 100644
--- a/addons/gamification/__openerp__.py
+++ b/addons/gamification/__openerp__.py
@@ -22,7 +22,7 @@
'name': 'Gamification',
'version': '1.0',
'author': 'OpenERP SA',
- 'category': 'Human Resources',
+ 'category': 'Human Ressources',
'depends': ['mail'],
'description': """
Gamification process
diff --git a/addons/gamification/doc/gamification_plan_howto.rst b/addons/gamification/doc/gamification_plan_howto.rst
index a0b6eefb7da..5669c0408db 100644
--- a/addons/gamification/doc/gamification_plan_howto.rst
+++ b/addons/gamification/doc/gamification_plan_howto.rst
@@ -1,15 +1,15 @@
-How to create new goal plan for my addon
+How to create new challenge for my addon
========================================
Running example
+++++++++++++++
-A module to create and manage groceries lists has been developped. To motivate users to use it, a goal plan is developped. This how to will explain the creation of a dedicated module and the XML file for the required data.
+A module to create and manage groceries lists has been developped. To motivate users to use it, a challenge (gamification.goal.plan) is developped. This how to will explain the creation of a dedicated module and the XML file for the required data.
Module
++++++
-The goal plan for my addon will consist of an auto-installed module containing only the definition of goals. Goal type are quite technical to create and should not be seen or modified through the web interface.
+The challenge for my addon will consist of an auto-installed module containing only the definition of goals. Goal type are quite technical to create and should not be seen or modified through the web interface.
If our groceries module is called ``groceries``, the structure will be consisted of three addons :
@@ -58,13 +58,13 @@ To be able to compute the number of lines, the model containing groceries is req
-As we do not want to count every recorded item, we will use a domain to restrict the selection on the user (display the count only for the items the users will be buying) and the state (only the items whose list is confirmed are included). The user restriction is made with the keyword ``user_id`` in the domain. During the evaluation, it is replaced by the user ID of the linked goal.
+As we do not want to count every recorded item, we will use a domain to restrict the selection on the user (display the count only for the items the users has bought) and the state (only the items whose list is confirmed are included). The user restriction is made with the keyword ``user_id`` in the domain and should correspond to a many2one field with the relation ``res.users``. During the evaluation, it is replaced by the user ID of the linked goal.
::
...
- [('shopper_id', '=' ,user_id), ('list_id.state', '=', 'confirmed')]
+ [('shopper_id', '=', user_id), ('list_id.state', '=', 'confirmed')]
An action can also be defined to help users to quickly reach the screen where they will be able to modify their current value. This is done by adding the XML ID of the ir.action we want to call. In our example, we would like to open the grocery list form view owned by the user.
@@ -83,14 +83,10 @@ If we do not specify a res_id to the action, only the list of records can be dis
Plan definition
++++++++++++++++
-Once all the goal types are defined, a goal plan can be created. In our example, we would like to create a plan "Discover the Groceries Module" with simple tasks applied to every new user in the group ``groceries.shoppers_group``. This goal plan should only be applied once by user so no recurring date is selected.
+Once all the goal types are defined, a challenge (or goal plan) can be created. In our example, we would like to create a plan "Discover the Groceries Module" with simple tasks applied to every new user in the group ``groceries.shoppers_group``. This goal plan should only be applied once by user and with no ending period, no dates or peridocity is then selected. The goal will be started manually but specifying a value to ``start_date`` can make it start automatically.
::
-
-
- 3
-
-
+
Discover the Groceries Moduleonce
@@ -98,10 +94,14 @@ Once all the goal types are defined, a goal plan can be created. In our example,
never
-
-
+To add goal types to a plan, planlines must be created. The value to reach is defined for a planline, this will be the ``target_goal`` for each goal generated.
+
+::
+
+
+ 3
\ No newline at end of file
diff --git a/addons/gamification/goal.py b/addons/gamification/goal.py
index 5d7bddd4a3f..3c788abc22e 100644
--- a/addons/gamification/goal.py
+++ b/addons/gamification/goal.py
@@ -157,7 +157,7 @@ class gamification_goal(osv.Model):
if not type_id:
return {'value': {'type_id': False}}
goal_type = goal_type.browse(cr, uid, type_id, context=context)
- ret = {'value': {'computation_mode': goal_type.computation_mode}}
+ ret = {'value': {'computation_mode': goal_type.computation_mode, 'type_condition': goal_type.condition}}
return ret
_columns = {
diff --git a/addons/gamification/goal_view.xml b/addons/gamification/goal_view.xml
index fc1fdbab4ee..9a913863455 100644
--- a/addons/gamification/goal_view.xml
+++ b/addons/gamification/goal_view.xml
@@ -79,7 +79,7 @@
-
+
Reached when current value is than the target.
diff --git a/addons/gamification/plan.py b/addons/gamification/plan.py
index 80867675bda..3917b9c11ae 100644
--- a/addons/gamification/plan.py
+++ b/addons/gamification/plan.py
@@ -757,6 +757,16 @@ class gamification_goal_planline(osv.Model):
result[p_id] = True
return result.keys()
+ def on_change_type_id(self, cr, uid, ids, type_id=False, context=None):
+ goal_type = self.pool.get('gamification.goal.type')
+ if not type_id:
+ return {'value': {'type_id': False}}
+ goal_type = goal_type.browse(cr, uid, type_id, context=context)
+ ret = {'value': {
+ 'type_condition': goal_type.condition,
+ 'type_full_suffix': goal_type.full_suffix}}
+ return ret
+
_columns = {
'name': fields.related('type_id', 'name', string="Name"),
'plan_id': fields.many2one('gamification.goal.plan',
diff --git a/addons/gamification/plan_view.xml b/addons/gamification/plan_view.xml
index f41e54c0599..1f0a872acf5 100644
--- a/addons/gamification/plan_view.xml
+++ b/addons/gamification/plan_view.xml
@@ -75,7 +75,7 @@
-
+
diff --git a/addons/gamification_sale_crm/__openerp__.py b/addons/gamification_sale_crm/__openerp__.py
index 429292e0025..adfb8de08e0 100644
--- a/addons/gamification_sale_crm/__openerp__.py
+++ b/addons/gamification_sale_crm/__openerp__.py
@@ -22,7 +22,7 @@
'name': 'CRM Gamification',
'version': '1.0',
'author': 'OpenERP SA',
- 'category': 'CRM',
+ 'category': 'hidden',
'depends': ['gamification','sale_crm'],
'description': """Example of goal types and plans that can be used related to the usage of the CRM Sale module.""",
diff --git a/addons/hr_gamification/__openerp__.py b/addons/hr_gamification/__openerp__.py
index ed7a18dd3e9..d98e7df3f24 100644
--- a/addons/hr_gamification/__openerp__.py
+++ b/addons/hr_gamification/__openerp__.py
@@ -22,7 +22,7 @@
'name': 'HR Gamification',
'version': '1.0',
'author': 'OpenERP SA',
- 'category': 'HR',
+ 'category': 'hidden',
'depends': ['gamification', 'hr'],
'description': """Use the HR ressources for the gamification process.