From bc85c457ad9c10a3a011ed2bb0d1d1a00e003625 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Tue, 15 Apr 2025 16:46:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=88=80=E5=85=B7=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=8A=B6=E6=80=81=E5=8F=98=E6=9B=B4=E8=B7=9F=E8=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_tool_management/models/functional_tool.py | 5 +++-- sf_tool_management/views/functional_tool_views.xml | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sf_tool_management/models/functional_tool.py b/sf_tool_management/models/functional_tool.py index 63a31b82..a9dddc0e 100644 --- a/sf_tool_management/models/functional_tool.py +++ b/sf_tool_management/models/functional_tool.py @@ -10,6 +10,7 @@ from odoo.exceptions import ValidationError class FunctionalCuttingToolEntity(models.Model): _name = 'sf.functional.cutting.tool.entity' + _inherit = ['mail.thread'] _description = '功能刀具列表' _order = 'functional_tool_status' @@ -41,7 +42,7 @@ class FunctionalCuttingToolEntity(models.Model): max_lifetime_value = fields.Integer(string='最大寿命值(min)', readonly=True) alarm_value = fields.Integer(string='报警值(min)', readonly=True) used_value = fields.Integer(string='已使用值(min)', readonly=True) - functional_tool_status = fields.Selection([('正常', '正常'), ('报警', '报警'), ('已拆除', '已拆除')], + functional_tool_status = fields.Selection([('正常', '正常'), ('报警', '报警'), ('已拆除', '已拆除')], tracking=True, string='状态', store=True, default='正常') current_location_id = fields.Many2one('stock.location', string='当前位置', compute='_compute_current_location_id', store=True) @@ -263,7 +264,7 @@ class FunctionalCuttingToolEntity(models.Model): functional_tool_model_ids.append(functional_tool_model.id) return [(6, 0, functional_tool_model_ids)] - dismantle_num = fields.Integer('拆解单数量', compute='_compute_dismantle_num', store=True) + dismantle_num = fields.Integer('拆解单数量', compute='_compute_dismantle_num', tracking=True, store=True) dismantle_ids = fields.One2many('sf.functional.tool.dismantle', 'functional_tool_id', '拆解单') @api.depends('dismantle_ids') diff --git a/sf_tool_management/views/functional_tool_views.xml b/sf_tool_management/views/functional_tool_views.xml index 2b872053..a306d6dd 100644 --- a/sf_tool_management/views/functional_tool_views.xml +++ b/sf_tool_management/views/functional_tool_views.xml @@ -192,6 +192,10 @@ +
+ + +