summaryrefslogtreecommitdiff
path: root/addons/gamification
diff options
context:
space:
mode:
authorAdrian Torres <adt@odoo.com>2018-09-24 12:22:45 +0200
committerAdrian Torres <adt@odoo.com>2018-09-27 12:10:23 +0200
commit3f4f77fd9d5c79c21665fa08d703bba7571decd8 (patch)
treecb4c161d09ead94255ea40e545ed5225ab113a8a /addons/gamification
parent52a8ed3c0c72b21baf589bc9b91a030d9da661a8 (diff)
[REF] *: adapt code to new related default behaviour
This commit adapts the business code to changes introduced by the parent commit in order to keep the same behaviour as before. All readonly=False fields will have to be checked afterwards to confirm that the business case requires write access to the source field.
Diffstat (limited to 'addons/gamification')
-rw-r--r--addons/gamification/models/badge.py2
-rw-r--r--addons/gamification/models/challenge.py2
-rw-r--r--addons/gamification/models/goal.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/addons/gamification/models/badge.py b/addons/gamification/models/badge.py
index 4e0d9d1c27c..6686b29fee5 100644
--- a/addons/gamification/models/badge.py
+++ b/addons/gamification/models/badge.py
@@ -21,7 +21,7 @@ class BadgeUser(models.Model):
badge_id = fields.Many2one('gamification.badge', string='Badge', required=True, ondelete="cascade", index=True)
challenge_id = fields.Many2one('gamification.challenge', string='Challenge originating', help="If this badge was rewarded through a challenge")
comment = fields.Text('Comment')
- badge_name = fields.Char(related='badge_id.name', string="Badge Name")
+ badge_name = fields.Char(related='badge_id.name', string="Badge Name", readonly=False)
def _send_badge(self):
"""Send a notification to a user for receiving a badge
diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py
index 1c088cd2bac..bf8e17fa4a2 100644
--- a/addons/gamification/models/challenge.py
+++ b/addons/gamification/models/challenge.py
@@ -781,7 +781,7 @@ class ChallengeLine(models.Model):
sequence = fields.Integer('Sequence', help='Sequence number for ordering', default=1)
target_goal = fields.Float('Target Value to Reach', required=True)
- name = fields.Char("Name", related='definition_id.name')
+ name = fields.Char("Name", related='definition_id.name', readonly=False)
condition = fields.Selection("Condition", related='definition_id.condition', readonly=True)
definition_suffix = fields.Char("Unit", related='definition_id.suffix', readonly=True)
definition_monetary = fields.Boolean("Monetary", related='definition_id.monetary', readonly=True)
diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py
index 3f98b352bc9..a812764e5c6 100644
--- a/addons/gamification/models/goal.py
+++ b/addons/gamification/models/goal.py
@@ -172,7 +172,7 @@ class Goal(models.Model):
to_update = fields.Boolean('To update')
closed = fields.Boolean('Closed goal', help="These goals will not be recomputed.")
- computation_mode = fields.Selection(related='definition_id.computation_mode')
+ computation_mode = fields.Selection(related='definition_id.computation_mode', readonly=False)
remind_update_delay = fields.Integer(
"Remind delay", help="The number of days after which the user "
"assigned to a manual goal will be reminded. "