game/addons/game_base/models/announcement.py

21 lines
631 B
Python

from odoo import models, fields
class GameAnnouncement(models.Model):
_name = 'game.announcement'
_description = '公告'
_rec_name = 'name'
_order = 'date desc, id desc'
PRIORITY = [
('normal', '普通'),
('important', '重要'),
('urgent', '紧急'),
]
name = fields.Char(string='标题', required=True)
body_html = fields.Html(string='正文')
date = fields.Date(string='发布日期', default=fields.Date.today)
priority = fields.Selection(PRIORITY, string='优先级', default='normal', index=True)
active = fields.Boolean(string='生效', default=True)