From bba4e55770333b2eed5badce313bfb078784b075 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Wed, 31 Jul 2024 10:40:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1=E3=80=81=E5=88=80=E5=85=B7=E7=BB=84?= =?UTF-8?q?=E8=A3=85=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=97=A5=E5=BF=97=EF=BC=9B2=E3=80=81?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E6=A6=82=E8=A7=88=E7=9C=8B=E6=9D=BF=E6=8C=89?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=B1=BB=E5=9E=8B=E5=88=86=E7=BB=84=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E4=BC=98=E5=8C=96=E5=B1=95=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_tool_management/wizard/wizard.py | 4 ++++ sf_warehouse/views/view.xml | 3 +++ 2 files changed, 7 insertions(+) diff --git a/sf_tool_management/wizard/wizard.py b/sf_tool_management/wizard/wizard.py index 95ffe45e..7ae92d65 100644 --- a/sf_tool_management/wizard/wizard.py +++ b/sf_tool_management/wizard/wizard.py @@ -603,6 +603,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel): 功能刀具组装 :return: """ + logging.info('功能刀具开始组装!') # 获取组装单对象 functional_tool_assembly = self.env['sf.functional.tool.assembly'].search([ ('assembly_order_code', '=', self.assembly_order_code), @@ -649,6 +650,8 @@ class FunctionalToolAssemblyOrder(models.TransientModel): ]) cam_plan.write({'plan_execute_status': '2'}) + logging.info('功能刀具组装完成!') + # 关闭弹出窗口 return {'type': 'ir.actions.act_window_close'} @@ -865,6 +868,7 @@ class StockPicking(models.Model): # 设置数量,并验证完成 picking_id.action_set_quantities_to_reservation() picking_id.button_validate() + logging.info(f'刀具物料调拨单状态:{picking_id.state}') def _get_name_stock1(self, picking_type_id): name = f'{picking_type_id.sequence_id.prefix}DJ/{date.today().strftime("%y")}' diff --git a/sf_warehouse/views/view.xml b/sf_warehouse/views/view.xml index 0b2c611e..fadaa58f 100644 --- a/sf_warehouse/views/view.xml +++ b/sf_warehouse/views/view.xml @@ -2,6 +2,9 @@ + + {'search_default_groupby_code':1} + stock.location.form.sf.inherit From ffb775abb7ef247b06096389bc1446269f95515e Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Wed, 31 Jul 2024 11:45:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 3 +++ sf_manufacturing/models/mrp_workorder.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index e4dfb2a8..1b1aea17 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -687,6 +687,9 @@ class MrpProduction(models.Model): for work_id in work_ids: if panel_sequence_list.get(work_id.name): work_id.sequence = panel_sequence_list[work_id.name] + if rec.tool_state in ['1', '2']: + rec.workorder_ids.filtered( + lambda a: a.routing_type == '装夹预调' and a.state in 'ready').compute_state() # 创建工单并进行排序 def _create_workorder(self, item): diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index b6622419..6989eb8f 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -988,6 +988,9 @@ class ResMrpWorkOrder(models.Model): # elif workorder.production_id.reservation_state != 'assigned' and workorder.state == 'ready': # workorder.state = 'waiting' + def compute_state(self): + self._compute_state() + # 重写工单开始按钮方法 def button_start(self): if self.routing_type == '装夹预调':