From 80aa17aac79f19cfb488998451c2cd536c00645e Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 2 Sep 2016 10:39:56 +0200 Subject: [PATCH] [FIX] note: properly set the default method stage_id is comptued and based on stage_ids The default value should be put on stage_ids, not stage_id, it has the same effect but avoids an unecessary chain update. --- addons/note/models/note.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/note/models/note.py b/addons/note/models/note.py index e6dba8a8777..439722d13ee 100644 --- a/addons/note/models/note.py +++ b/addons/note/models/note.py @@ -45,8 +45,9 @@ class Note(models.Model): memo = fields.Html('Note Content') sequence = fields.Integer('Sequence') stage_id = fields.Many2one('note.stage', compute='_compute_stage_id', - inverse='_inverse_stage_id', default=_get_default_stage_id, string='Stage') - stage_ids = fields.Many2many('note.stage', 'note_stage_rel', 'note_id', 'stage_id', string='Stages of Users') + inverse='_inverse_stage_id', string='Stage') + stage_ids = fields.Many2many('note.stage', 'note_stage_rel', 'note_id', 'stage_id', + string='Stages of Users', default=_get_default_stage_id) open = fields.Boolean(string='Active', track_visibility='onchange', default=True) date_done = fields.Date('Date done') color = fields.Integer(string='Color Index')