18 lines
722 B
Python
18 lines
722 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
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)
|