flectra/addons/website_forum_doc/models/forum_post.py

18 lines
722 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
2018-01-16 11:34:37 +01:00
from flectra import api, fields, models
class Post(models.Model):
_inherit = 'forum.post'
documentation_toc_id = fields.Many2one('forum.documentation.toc', string='Documentation ToC',
ondelete='set null', group_expand='_read_group_stage_ids')
documentation_stage_id = fields.Many2one('forum.documentation.stage', string='Documentation Stage',
default=lambda self: self.env['forum.documentation.stage'].search([], limit=1))
color = fields.Integer(string='Color Index')
@api.model
def _read_group_stage_ids(self, stages, domain, order):
return stages.search([], order=order)