From c5bb9a32d0f1bc992b48cc1cfb1f3a0c9563d60e Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Wed, 28 Aug 2024 14:50:39 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=A4=9A=E9=9D=A2=E5=B7=A5=E8=89=BA?= =?UTF-8?q?=E6=8E=92=E7=A8=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index c67fd105..efa84c52 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -770,9 +770,13 @@ class MrpProduction(models.Model): 'date_from': date_planned_start, 'date_to': date_planned_end, }) + # work.write({'date_planned_start': date_planned_start, 'date_planned_finished': date_planned_end}) work.date_planned_start = date_planned_start work.date_planned_finished = date_planned_end - # work.write({'date_planned_start': date_planned_start, 'date_planned_finished': date_planned_end}) + routing_workcenter = self.env['mrp.routing.workcenter'].sudo().search( + [('name', '=', work.routing_type)]) + + work.write({'date_planned_start': date_planned_start, 'date_planned_finished': date_planned_end,'duration_expected':routing_workcenter.time_cycle}) # 修改标记已完成方法 def button_mark_done1(self): From 2d2abfce25703bbffb7e001714a2aee2393a2f2e Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Wed, 28 Aug 2024 17:42:23 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 8bce60d6..28d6b467 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1170,7 +1170,7 @@ class ResMrpWorkOrder(models.Model): if not record.rfid_code and record.is_rework is False: raise UserError("请扫RFID码进行绑定") if not record.material_center_point or record.X_deviation_angle <= 0: - raise UserError("请对前置三元检测定位参数进行计算定位") + raise UserError("坯料中心点为空或X偏差角度小于等于0") record.process_state = '待加工' # record.write({'process_state': '待加工'}) record.production_id.process_state = '待加工' From 0e672aef79f8ed45150af52e9f60b5be9dcea604 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Wed, 28 Aug 2024 18:07:34 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=A3=85=E5=A4=B9?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 28d6b467..63ff1551 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1169,7 +1169,7 @@ class ResMrpWorkOrder(models.Model): if record.routing_type == '装夹预调': if not record.rfid_code and record.is_rework is False: raise UserError("请扫RFID码进行绑定") - if not record.material_center_point or record.X_deviation_angle <= 0: + if not record.material_center_point and record.X_deviation_angle > 0: raise UserError("坯料中心点为空或X偏差角度小于等于0") record.process_state = '待加工' # record.write({'process_state': '待加工'}) From f9063bf3d9293c2145d3daeea10aa07892f454fe Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Wed, 28 Aug 2024 20:31:20 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E6=8C=81=E4=B9=85?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_plan_management/i18n/zh_CN.po | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sf_plan_management/i18n/zh_CN.po b/sf_plan_management/i18n/zh_CN.po index 653f8e1e..0b957921 100644 --- a/sf_plan_management/i18n/zh_CN.po +++ b/sf_plan_management/i18n/zh_CN.po @@ -48565,3 +48565,16 @@ msgstr "" #: model:ir.model.fields.selection,name:sf_maintenance.selection__maintenance_equipment__heightened_way__chilunjia msgid "齿轮架驱动" msgstr "" + +#. module: sf_manufacturing +#. odoo-python +#: code:addons/sf_manufacturing/models/mrp_production.py:0 +#: model:ir.actions.act_window,name:sf_manufacturing.action_sf_production_wizard +#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_production__state__scrap +#: model:ir.model.fields.selection,name:sf_manufacturing.selection__mrp_workorder__test_results__报废 +#: model:ir.model.fields.selection,name:sf_manufacturing.selection__sf_detection_result__test_results__报废 +#: model_terms:ir.ui.view,arch_db:sf_manufacturing.custom_mrp_production_form_view +#: model_terms:ir.ui.view,arch_db:sf_manufacturing.custom_view_mrp_production_filter +#, python-format +msgid "报废" +msgstr "报废" \ No newline at end of file