diff options
| author | Christophe Simonis <chs@openerp.com> | 2014-04-24 15:45:33 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@openerp.com> | 2014-04-24 15:45:33 +0200 |
| commit | 7a7d7febf8d51cdc693e77678fc9eaee3864b3b2 (patch) | |
| tree | d2bb635b1441f04267727e39a4bfbd219a4b7b6b /addons/gamification | |
| parent | 96b9d8b9d59dc7b240a096e6c6775c7a45ac88c4 (diff) | |
| parent | 52cfc16c2e2f33395a53b255825a8153ec80ce40 (diff) | |
[MERGE] forward port of branch saas-3 up to revid 9429 chs@openerp.com-20140424123538-rxk9got9k2on1ki1
bzr revid: chs@openerp.com-20140424131824-4ksluvhnegp7kplb
bzr revid: chs@openerp.com-20140424134533-lhhcd32n3s0m9cqk
Diffstat (limited to 'addons/gamification')
| -rw-r--r-- | addons/gamification/data/badge.xml | 4 | ||||
| -rw-r--r-- | addons/gamification/data/cron.xml | 2 | ||||
| -rw-r--r-- | addons/gamification/data/goal_base.xml | 4 | ||||
| -rw-r--r-- | addons/gamification/models/challenge.py | 7 | ||||
| -rw-r--r-- | addons/gamification/security/gamification_security.xml | 7 |
5 files changed, 12 insertions, 12 deletions
diff --git a/addons/gamification/data/badge.xml b/addons/gamification/data/badge.xml index 33d02bf016e..cc9df921309 100644 --- a/addons/gamification/data/badge.xml +++ b/addons/gamification/data/badge.xml @@ -41,10 +41,6 @@ <field name="description">Badge Granted</field> </record> - </data> - - - <data noupdate="0"> <record id="email_template_badge_received" model="email.template"> <field name="name">Received Badge</field> diff --git a/addons/gamification/data/cron.xml b/addons/gamification/data/cron.xml index 8585771c97d..105f7d25681 100644 --- a/addons/gamification/data/cron.xml +++ b/addons/gamification/data/cron.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <openerp> - <data> + <data noupdate="1"> <record forcecreate="True" id="ir_cron_check_challenge" model="ir.cron"> <field name="name">Run Goal Challenge Checker</field> diff --git a/addons/gamification/data/goal_base.xml b/addons/gamification/data/goal_base.xml index c12763025f6..f249e566b9f 100644 --- a/addons/gamification/data/goal_base.xml +++ b/addons/gamification/data/goal_base.xml @@ -90,10 +90,6 @@ ]]></field> </record> - </data> - - <data> - <!-- goal definitions --> <record model="gamification.goal.definition" id="definition_base_timezone"> <field name="name">Set your Timezone</field> diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py index a0c4b638ae3..ecb4c495d94 100644 --- a/addons/gamification/models/challenge.py +++ b/addons/gamification/models/challenge.py @@ -200,7 +200,6 @@ class gamification_challenge(osv.Model): 'visibility_mode': 'personal', 'report_message_frequency': 'never', 'last_report_date': fields.date.today, - 'start_date': fields.date.today, 'manager_id': lambda s, cr, uid, c: uid, 'category': 'hr', 'reward_failure': False, @@ -269,13 +268,15 @@ class gamification_challenge(osv.Model): planned_challenge_ids = self.search(cr, uid, [ ('state', '=', 'draft'), ('start_date', '<=', fields.date.today())]) - self.write(cr, uid, planned_challenge_ids, {'state': 'inprogress'}, context=context) + if planned_challenge_ids: + self.write(cr, uid, planned_challenge_ids, {'state': 'inprogress'}, context=context) # close scheduled challenges planned_challenge_ids = self.search(cr, uid, [ ('state', '=', 'inprogress'), ('end_date', '>=', fields.date.today())]) - self.write(cr, uid, planned_challenge_ids, {'state': 'done'}, context=context) + if planned_challenge_ids: + self.write(cr, uid, planned_challenge_ids, {'state': 'done'}, context=context) if not ids: ids = self.search(cr, uid, [('state', '=', 'inprogress')], context=context) diff --git a/addons/gamification/security/gamification_security.xml b/addons/gamification/security/gamification_security.xml index 904ba50721e..5339b400061 100644 --- a/addons/gamification/security/gamification_security.xml +++ b/addons/gamification/security/gamification_security.xml @@ -39,5 +39,12 @@ <field name="domain_force">[(1, '=', 1)]</field> </record> + <record id="goal_global_multicompany" model="ir.rule"> + <field name="name">User can only see his/her goals or goal from the same challenge in board visibility</field> + <field name="model_id" ref="model_gamification_goal"/> + <field name="domain_force">[('user_id.company_id', 'child_of', [user.company_id.id])]</field> + <field name="global" eval="True"/> + </record> + </data> </openerp> |
