From fffc2eed4df51eed603bf0bafb24ea051e53808a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Mon, 1 Jun 2026 22:55:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E7=9A=84=E8=AE=B0=E5=BD=95=E8=A2=AB?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=8E=89=E4=BA=86=EF=BC=8C=E4=BF=9D=E5=AE=89?= =?UTF-8?q?=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tx_planning_resource/models/planning_slot.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tx_planning_resource/models/planning_slot.py b/tx_planning_resource/models/planning_slot.py index 01cc7f890..f35f55379 100644 --- a/tx_planning_resource/models/planning_slot.py +++ b/tx_planning_resource/models/planning_slot.py @@ -43,3 +43,9 @@ class TxPlanningSlot(models.Model): 'type': 'success', } } + + @api.depends('role_id', 'employee_id') + def _compute_template_autocomplete_ids(self): + domain = self._get_domain_template_slots() + templates = self.env['planning.slot.template'].search(domain, order='start_time', limit=15) + self.template_autocomplete_ids = templates + self.template_id