[IMP] default code as working example

bzr revid: mat@openerp.com-20130313145104-90orlzclxw7hqkt2
This commit is contained in:
Martin Trigaux 2013-03-13 15:51:04 +01:00
parent 3ad3048ea9
commit d7af254470
1 changed files with 6 additions and 0 deletions

View File

@ -169,6 +169,12 @@ class gamification_badge(osv.Model):
'stat_this_month': 0,
'rule_auth': 'everyone',
'rule_automatic': 'manual',
'compute_code': """# Example of python code to execute
# Use the variable 'result' to store the list of ids that will receive the badge
from openerp import pooler
pool = pooler.get_pool(cr.dbname)
# return the list of ALL users
result = pool.get('res.users').search(cr, uid, domain=[], context=context)""",
}
def send_badge(self, cr, uid, badge_id, badge_user_ids, user_from=None, context=None):