from odoo import models class McBatch(models.Model): _inherit = "mc.batch" def action_view_timetable(self): self.ensure_one() return { "type": "ir.actions.act_window", "name": "Timetable - %s" % self.name, "res_model": "mc.timetable.slot", "view_mode": "list,form", "domain": [("batch_id", "=", self.id)], "context": {"default_batch_id": self.id, "search_default_group_weekday": 1}, }