diff options
| author | Raphael Collet <rco@openerp.com> | 2014-07-06 16:44:26 +0200 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2014-07-06 17:05:41 +0200 |
| commit | cbe2dbb672a6c55d86f2e515f9d1cdfee426ef80 (patch) | |
| tree | d6ff62b719fce32392397783c961b734b1e4c50e /addons/gamification | |
| parent | d78192c489d3be66cd6487b39f5ce7ba4733a187 (diff) | |
[MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.
- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
Diffstat (limited to 'addons/gamification')
| -rw-r--r-- | addons/gamification/models/challenge.py | 6 | ||||
| -rw-r--r-- | addons/gamification/models/goal.py | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py index faed62f8da9..51e58bdc71b 100644 --- a/addons/gamification/models/challenge.py +++ b/addons/gamification/models/challenge.py @@ -124,7 +124,7 @@ class gamification_challenge(osv.Model): ('draft', 'Draft'), ('inprogress', 'In Progress'), ('done', 'Done'), - ], + ], copy=False, string='State', required=True, track_visibility='onchange'), 'manager_id': fields.many2one('res.users', string='Responsible', help="The user responsible for the challenge."), @@ -155,7 +155,7 @@ class gamification_challenge(osv.Model): 'line_ids': fields.one2many('gamification.challenge.line', 'challenge_id', string='Lines', help="List of goals that will be set", - required=True), + required=True, copy=True), 'reward_id': fields.many2one('gamification.badge', string="For Every Succeding User"), 'reward_first_id': fields.many2one('gamification.badge', string="For 1st user"), @@ -283,7 +283,7 @@ class gamification_challenge(osv.Model): # in cron mode, will do intermediate commits # TODO in trunk: replace by parameter - context.update({'commit_gamification': True}) + context = dict(context, commit_gamification=True) return self._update_all(cr, uid, ids, context=context) def _update_all(self, cr, uid, ids, context=None): diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py index 041c6ae169c..ce5be513aef 100644 --- a/addons/gamification/models/goal.py +++ b/addons/gamification/models/goal.py @@ -424,8 +424,7 @@ class gamification_goal(osv.Model): def create(self, cr, uid, vals, context=None): """Overwrite the create method to add a 'no_remind_goal' field to True""" - if context is None: - context = {} + context = dict(context or {}) context['no_remind_goal'] = True return super(gamification_goal, self).create(cr, uid, vals, context=context) |
