From b4a13dc8d479f4ab550ab5b784b6377e23f5c50f Mon Sep 17 00:00:00 2001 From: pengyuthon Date: Tue, 14 Apr 2026 09:50:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=9A=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_will_task/models/yuthon_will_task.py | 8 ++++++++ yuthon_will_task/views/yuthon_will_task_views.xml | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/yuthon_will_task/models/yuthon_will_task.py b/yuthon_will_task/models/yuthon_will_task.py index 8b92147ea..9a9b8723a 100644 --- a/yuthon_will_task/models/yuthon_will_task.py +++ b/yuthon_will_task/models/yuthon_will_task.py @@ -81,6 +81,7 @@ class YuthonWillTask(models.Model): employee_id = fields.Many2one('hr.employee', string="经办人", default=lambda self: self.env.user.employee_id) task_week = fields.Char(string="周", readonly=True, compute='_compute_task_week') + task_week2 = fields.Char(string="周", readonly=True, compute='_compute_task_week2') msg_id = fields.Char(string="msg_id") task_type = fields.Selection([ ('task', '日程'), @@ -128,6 +129,13 @@ class YuthonWillTask(models.Model): if record.start_date: record.task_week = weekdays[record.start_date.weekday()] + @api.depends('end_date') + def _compute_task_week2(self): + weekdays = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"] + for record in self: + if record.start_date: + record.task_week2 = weekdays[record.start_date.weekday()] + def one_time(self): will_ids = self.env["yuthon.will.task"].browse( self._context.get('active_ids', self._context.get('active_id'))) diff --git a/yuthon_will_task/views/yuthon_will_task_views.xml b/yuthon_will_task/views/yuthon_will_task_views.xml index 44253ecf2..cf9ba878b 100644 --- a/yuthon_will_task/views/yuthon_will_task_views.xml +++ b/yuthon_will_task/views/yuthon_will_task_views.xml @@ -106,7 +106,7 @@
- +
@@ -232,7 +232,7 @@
- +