[IMP] gamification: use evaluated version of the domain.
Needs server fix to avoid sending evaluated data. bzr revid: mat@openerp.com-20140418161053-lc970koh96wfe200
This commit is contained in:
parent
a6bcf53bd3
commit
130f572d81
|
@ -164,7 +164,7 @@
|
||||||
<field name="period">once</field>
|
<field name="period">once</field>
|
||||||
<field name="visibility_mode">personal</field>
|
<field name="visibility_mode">personal</field>
|
||||||
<field name="report_message_frequency">never</field>
|
<field name="report_message_frequency">never</field>
|
||||||
<field name="user_domain">[('groups_id', 'in', ref('base.group_user'))]</field>
|
<field name="user_domain" eval="[('groups_id', '=', ref('base.group_user'))]" />
|
||||||
<field name="state">inprogress</field>
|
<field name="state">inprogress</field>
|
||||||
<field name="category">other</field>
|
<field name="category">other</field>
|
||||||
</record>
|
</record>
|
||||||
|
@ -174,7 +174,7 @@
|
||||||
<field name="period">once</field>
|
<field name="period">once</field>
|
||||||
<field name="visibility_mode">personal</field>
|
<field name="visibility_mode">personal</field>
|
||||||
<field name="report_message_frequency">never</field>
|
<field name="report_message_frequency">never</field>
|
||||||
<field name="user_domain">[('groups_id', 'in', ref('base.user_root'))]</field>
|
<field name="user_domain" eval="[('groups_id', '=', ref('base.group_erp_manager'))]" />
|
||||||
<field name="state">inprogress</field>
|
<field name="state">inprogress</field>
|
||||||
<field name="category">other</field>
|
<field name="category">other</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
|
@ -212,7 +212,6 @@ class gamification_challenge(osv.Model):
|
||||||
def create(self, cr, uid, vals, context=None):
|
def create(self, cr, uid, vals, context=None):
|
||||||
"""Overwrite the create method to add the user of groups"""
|
"""Overwrite the create method to add the user of groups"""
|
||||||
|
|
||||||
# add users when change the group auto-subscription
|
|
||||||
if vals.get('user_domain'):
|
if vals.get('user_domain'):
|
||||||
user_ids = self._get_challenger_users(cr, uid, vals.get('user_domain'), context=context)
|
user_ids = self._get_challenger_users(cr, uid, vals.get('user_domain'), context=context)
|
||||||
|
|
||||||
|
@ -233,7 +232,14 @@ class gamification_challenge(osv.Model):
|
||||||
def write(self, cr, uid, ids, vals, context=None):
|
def write(self, cr, uid, ids, vals, context=None):
|
||||||
if isinstance(ids, (int,long)):
|
if isinstance(ids, (int,long)):
|
||||||
ids = [ids]
|
ids = [ids]
|
||||||
|
|
||||||
|
if vals.get('user_domain'):
|
||||||
|
user_ids = self._get_challenger_users(cr, uid, vals.get('user_domain'), context=context)
|
||||||
|
|
||||||
|
if not vals.get('user_ids'):
|
||||||
|
vals['user_ids'] = []
|
||||||
|
vals['user_ids'] += [(4, user_id) for user_id in user_ids]
|
||||||
|
|
||||||
write_res = super(gamification_challenge, self).write(cr, uid, ids, vals, context=context)
|
write_res = super(gamification_challenge, self).write(cr, uid, ids, vals, context=context)
|
||||||
|
|
||||||
if vals.get('state') == 'inprogress':
|
if vals.get('state') == 'inprogress':
|
||||||
|
|
|
@ -130,7 +130,7 @@
|
||||||
<field name="name">Monthly Sales Targets</field>
|
<field name="name">Monthly Sales Targets</field>
|
||||||
<field name="period">monthly</field>
|
<field name="period">monthly</field>
|
||||||
<field name="visibility_mode">ranking</field>
|
<field name="visibility_mode">ranking</field>
|
||||||
<field name="user_domain">[('groups_id', 'in', ref('base.group_sale_salesman'))]</field>
|
<field name="user_domain" eval="[('groups_id', 'in', ref('base.group_sale_salesman'))]" />
|
||||||
<field name="report_message_frequency">weekly</field>
|
<field name="report_message_frequency">weekly</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@
|
||||||
<field name="name">Lead Acquisition</field>
|
<field name="name">Lead Acquisition</field>
|
||||||
<field name="period">monthly</field>
|
<field name="period">monthly</field>
|
||||||
<field name="visibility_mode">ranking</field>
|
<field name="visibility_mode">ranking</field>
|
||||||
<field name="user_domain">[('groups_id', 'in', ref('base.group_sale_salesman'))]</field>
|
<field name="user_domain" eval="[('groups_id', 'in', ref('base.group_sale_salesman'))]" />"
|
||||||
<field name="report_message_frequency">weekly</field>
|
<field name="report_message_frequency">weekly</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue