From 006a2663966ff0c6edde19d7635cc7a89ce6e71f Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 23 Apr 2013 17:55:32 +0200 Subject: [PATCH] [IMP] on change, doc and catergory bzr revid: mat@openerp.com-20130423155532-yxqq2nchuaeyxste --- addons/gamification/__openerp__.py | 2 +- .../doc/gamification_plan_howto.rst | 26 +++++++++---------- addons/gamification/goal.py | 2 +- addons/gamification/goal_view.xml | 2 +- addons/gamification/plan.py | 10 +++++++ addons/gamification/plan_view.xml | 2 +- addons/gamification_sale_crm/__openerp__.py | 2 +- addons/hr_gamification/__openerp__.py | 2 +- 8 files changed, 29 insertions(+), 19 deletions(-) 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 Module once @@ -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 @@