diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 6f6e8826..d2b63cb9 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): diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index f9998587..485eb290 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1166,9 +1166,9 @@ class ResMrpWorkOrder(models.Model): if record.routing_type == '装夹预调': if not record.rfid_code and record.is_rework is False: raise UserError("请扫RFID码进行绑定") - # if record.is_rework is False: - # if not record.material_center_point or record.X_deviation_angle <= 0: - # raise UserError("请对前置三元检测定位参数进行计算定位") + if record.is_rework is False: + if not record.material_center_point or record.X_deviation_angle <= 0: + raise UserError("请对前置三元检测定位参数进行计算定位") record.process_state = '待加工' # record.write({'process_state': '待加工'}) record.production_id.process_state = '待加工' 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