from odoo import fields, models class McNotice(models.Model): _name = "mc.notice" _inherit = ["mail.thread"] _description = "Notice" _order = "date desc" _rec_name = "title" title = fields.Char(string="Title", required=True, tracking=True) body = fields.Html(string="Body", required=True) date = fields.Date(string="Date", required=True, default=fields.Date.context_today) batch_id = fields.Many2one( "mc.batch", string="Batch", help="Leave blank for a school-wide notice, or set to target one batch's " "guardians and students only.", ) company_id = fields.Many2one( "res.company", string="Company", required=True, default=lambda self: self.env.company, )