diff --git a/addons/gamification/plan.py b/addons/gamification/plan.py
index 159fd295614..c49f2775372 100644
--- a/addons/gamification/plan.py
+++ b/addons/gamification/plan.py
@@ -213,8 +213,6 @@ class gamification_goal_plan(osv.Model):
if not ids:
ids = self.search(cr, uid, [('state', '=', 'inprogress')])
- self.generate_goals_from_plan(cr, uid, ids, context=context)
-
goal_obj = self.pool.get('gamification.goal')
# we use yesterday to update the goals that just ended
yesterday = date.today() - timedelta(days=1)
@@ -237,6 +235,9 @@ class gamification_goal_plan(osv.Model):
:param list(int) ids: the ids of the plans to update, if False will
update only plans in progress."""
if not context: context = {}
+ goal_obj = self.pool.get('gamification.goal')
+
+ self.generate_goals_from_plan(cr, uid, ids, context=context)
for plan in self.browse(cr, uid, ids, context=context):
# goals closed but still opened at the last report date
diff --git a/addons/gamification_sale_crm/sale_crm_goals.xml b/addons/gamification_sale_crm/sale_crm_goals.xml
index f4b920822ad..3308b860e8d 100644
--- a/addons/gamification_sale_crm/sale_crm_goals.xml
+++ b/addons/gamification_sale_crm/sale_crm_goals.xml
@@ -10,13 +10,12 @@
- [('state','!=','cancel'),('user_id','=',user_id)]
-
-
+ [('state','!=','cancel'),('user_id','=',user_id),('type','=','out_invoice')]
+
Time to Qualify a Lead
- The average number of days to open the case (less than)
+ The average number of days to open the case (lower than)
sum
lower
@@ -27,7 +26,7 @@
Days to Close a Deal
- The average number of days to close the case (less than)
+ The average number of days to close the case (lower than)
sum
lower
@@ -73,45 +72,42 @@
[('user_id','=',user_id),('state','not in',('draft', 'sent', 'cancel'))]
-
# Paid Sales Orders
- Based on the confirmation date
+ Based on the invoice date
count
-
-
- [('user_id','=',user_id),('invoiced','=',True)]
+
+
+ [('state','=','paid'),('user_id','=',user_id),('type','=','out_invoice')]
-
Total Paid Sales Orders
- Based on the confirmation date
- sum
-
-
-
- [('user_id','=',user_id),('invoiced','=',True)]
+ Based on the invoice date
+ count
+
+
+
+ [('state','=','paid'),('user_id','=',user_id),('type','=','out_invoice')]
# Customer Refunds
- Refund the least customers
+ Refund the least customers (lower than)
count
lower
-
-
+
+
[('state','!=','cancel'),('user_id','=',user_id),('type','=','out_refund')]
-
Total Customer Refunds
-
+ The total refunded value is a negative value. Validated when higher (min refunded).
sum
higher
-
-
-
+
+
+
[('state','!=','cancel'),('user_id','=',user_id),('type','=','out_refund')]
@@ -160,7 +156,7 @@
- Saleperson
+ Salesperson
monthly
board