summaryrefslogtreecommitdiff
path: root/addons/gamification/views
diff options
context:
space:
mode:
authorBenoit Socias <bso@odoo.com>2020-12-08 14:20:43 +0000
committerJeremy Kersten <jke@odoo.com>2020-12-11 16:09:35 +0000
commit0f9411d10753aa96103ce77702dbdc0516e9969a (patch)
treefc5edb26e763a94275bbd57d3d9d9747063bc361 /addons/gamification/views
parentd33d7bdf21d8a0743a1fa10b9f248d42a20f7785 (diff)
[IMP] gamification,gamification_sale_crm: compute goals using batch mode
Trying to improve the resources used by the challenge update cron operation. Before this commit some count-based goals and all sum-based goals were computed with one select count or sum per user. After this commit each count or sum based goal is computed in a single select for all users. The goal form now also allows to enable batch mode for sum computations. Other changes include: - adding an index on the challenge_id of goals after verifying the positive impact of such an index on high volumes on a staging server - introducing additional intermediary commits to allow massive crons to catch up over several attempts. task-internal closes odoo/odoo#63030 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Diffstat (limited to 'addons/gamification/views')
-rw-r--r--addons/gamification/views/goal.xml2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/gamification/views/goal.xml b/addons/gamification/views/goal.xml
index 2f7f3719290..bfba69b5c43 100644
--- a/addons/gamification/views/goal.xml
+++ b/addons/gamification/views/goal.xml
@@ -252,7 +252,7 @@
<field name="compute_code" attrs="{'invisible':[('computation_mode','!=','python')], 'required':[('computation_mode','=','python')]}"/>
<field name="condition" widget="radio"/>
</group>
- <group string="Optimisation" name="optimisation" attrs="{'invisible': [('computation_mode', '!=', 'count')]}">
+ <group string="Optimisation" name="optimisation" attrs="{'invisible': [('computation_mode', 'not in', ('sum', 'count'))]}">
<field name="batch_mode" />
<div colspan="2">In batch mode, the domain is evaluated globally. If enabled, do not use keyword 'user' in above filter domain.</div>
<field name="batch_distinctive_field" attrs="{'invisible': [('batch_mode', '=', False)], 'required': [('batch_mode', '=', True)]}"