2018-01-16 06:58:15 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2018-01-16 11:34:37 +01:00
|
|
|
from flectra import api, fields, models
|
2018-01-16 06:58:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
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)
|