diff options
| author | Martin Trigaux <mat@odoo.com> | 2016-09-02 10:39:56 +0200 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2016-09-02 12:03:41 +0200 |
| commit | 80aa17aac79f19cfb488998451c2cd536c00645e (patch) | |
| tree | db48ad4e8d8a413a15d2e819f6e65523147151f3 /addons/note | |
| parent | 583e92b18ef2cae824a5861b3472e65ac0efb5dc (diff) | |
[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.
Diffstat (limited to 'addons/note')
| -rw-r--r-- | addons/note/models/note.py | 5 |
1 files 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') |
