From 722f6257ae02bf443d0c4bba2a1000589bbea69f Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Fri, 13 Sep 2024 17:37:20 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E5=88=80=E5=85=B7?= =?UTF-8?q?=E6=8B=86=E8=A7=A3=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_tool_management/models/base.py | 31 +++++++++----------- sf_tool_management/views/tool_base_views.xml | 3 +- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/sf_tool_management/models/base.py b/sf_tool_management/models/base.py index 76fb20ff..d9ab1536 100644 --- a/sf_tool_management/models/base.py +++ b/sf_tool_management/models/base.py @@ -1505,29 +1505,26 @@ class FunctionalToolDismantle(models.Model): 'handle_code_id': self.handle_lot_id.id, 'handle_product_id': self.handle_product_id.id, 'loading_task_source': '3', + 'use_tool_time': fields.Datetime.now() + timedelta(hours=4), 'reason_for_applying': '刀具寿命到期' }) - action = self.env.ref('sf_tool_management.sf_functional_tool_assembly_form') return { - 'type': 'ir.actions.client', - 'tag': 'display_notification', - 'params': { - 'title': '组装单创建完成', - 'message': '请组装同名称的功能刀具', - 'type': 'info', - 'links': [{ - 'label': '组装单', - 'url': f'#action={action.id}&id={assembly_id.id}&model=sf.functional.tool.assembly', - }], - }, + 'type': 'ir.actions.act_window', + 'res_model': 'sf.functional.tool.assembly', + 'view_type': 'form', + 'view_mode': 'form', + 'res_id': assembly_id.id, + # 'target': 'new' } # { - # 'type': 'ir.actions.act_window', - # 'res_model': 'sf.functional.tool.assembly', - # 'view_type': 'form', - # 'view_mode': 'form', - # 'res_id': assembly_id.id, + # 'type': 'ir.actions.client', + # 'tag': 'display_notification', + # 'params': { + # 'title': '组装单创建完成', + # 'message': '请组装同名称的功能刀具', + # 'type': 'info' + # } # } # 'params': { diff --git a/sf_tool_management/views/tool_base_views.xml b/sf_tool_management/views/tool_base_views.xml index ab4912ce..2a68ce8e 100644 --- a/sf_tool_management/views/tool_base_views.xml +++ b/sf_tool_management/views/tool_base_views.xml @@ -891,7 +891,8 @@ - +