From 098021a87f459a28476b476a263b700531be97ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Fri, 3 Jul 2026 19:12:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E6=95=B0=EF=BC=8C=E7=9B=98?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_stock/__manifest__.py | 1 - yuthon_stock/data/inventory_cron.xml | 15 --------------- yuthon_stock/models/yuthon_inventory_task.py | 15 --------------- 3 files changed, 31 deletions(-) delete mode 100644 yuthon_stock/data/inventory_cron.xml diff --git a/yuthon_stock/__manifest__.py b/yuthon_stock/__manifest__.py index 7e0119241..0cb22026b 100644 --- a/yuthon_stock/__manifest__.py +++ b/yuthon_stock/__manifest__.py @@ -10,7 +10,6 @@ 'data': [ 'data/sequence.xml', 'data/inventory_sequence.xml', - 'data/inventory_cron.xml', 'security/ir.model.access.csv', 'security/company_rule.xml', 'wizard/stock_picking_transfer_wizard_views.xml', diff --git a/yuthon_stock/data/inventory_cron.xml b/yuthon_stock/data/inventory_cron.xml deleted file mode 100644 index 0c059794f..000000000 --- a/yuthon_stock/data/inventory_cron.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - 盘点任务提醒 - - code - model.action_send_reminder() - 1 - days - -1 - False - - - diff --git a/yuthon_stock/models/yuthon_inventory_task.py b/yuthon_stock/models/yuthon_inventory_task.py index 06397aba9..87a15d2d9 100644 --- a/yuthon_stock/models/yuthon_inventory_task.py +++ b/yuthon_stock/models/yuthon_inventory_task.py @@ -19,7 +19,6 @@ class YuthonInventoryTask(models.Model): name = fields.Char(string='盘点名称', required=True, index=True) code = fields.Char(string='编号', readonly=True, copy=False, default='New') - planned_date = fields.Datetime(string='计划盘点时间') employee_ids = fields.Many2many( 'hr.employee', 'inventory_task_employee_rel', @@ -57,7 +56,6 @@ class YuthonInventoryTask(models.Model): sheet_count = fields.Integer(string='盘点表数', compute='_compute_sheet_count') note = fields.Text(string='备注') - reminded = fields.Boolean(string='已提醒', default=False, copy=False) create_uid = fields.Many2one('res.users', string='创建人', readonly=True) create_date = fields.Datetime(string='创建时间', readonly=True) @@ -339,16 +337,3 @@ class YuthonInventoryTask(models.Model): 'domain': [('task_id', '=', self.id)], 'target': 'current', } - - def action_send_reminder(self): - """手动触发提醒(供 cron 调用)""" - now = fields.Datetime.now() - tasks = self.search([ - ('state', '=', 'confirmed'), - ('planned_date', '!=', False), - ('planned_date', '<=', now), - ('reminded', '=', False), - ]) - for task in tasks: - # TODO: 接入企业微信后,此处发送消息给 task.employee_ids - task.reminded = True