Merge branch 'feature/工单-制造订单优化' into feature/返工功能优化
This commit is contained in:
@@ -1248,6 +1248,8 @@ class MrpProduction(models.Model):
|
||||
cloud_programming = None
|
||||
if self.programming_state in ['已编程']:
|
||||
cloud_programming = self._cron_get_programming_state()
|
||||
elif self.programming_state is False:
|
||||
cloud_programming = {}
|
||||
result_ids = self.detection_result_ids.filtered(lambda dr: dr.handle_result == '待处理')
|
||||
work_id_list = []
|
||||
if result_ids:
|
||||
@@ -1268,9 +1270,9 @@ class MrpProduction(models.Model):
|
||||
'default_production_id': self.id,
|
||||
'default_workorder_ids': workorder_ids.ids if workorder_ids.ids != [] else self.workorder_ids.ids,
|
||||
'default_hidden_workorder_ids': ','.join(map(str, work_id_list)) if work_id_list != [] else '',
|
||||
'default_reprogramming_num': cloud_programming['reprogramming_num'],
|
||||
'default_programming_state': cloud_programming['programming_state'],
|
||||
'default_is_reprogramming': True if cloud_programming['programming_state'] in ['已下发'] else False
|
||||
'default_reprogramming_num': cloud_programming.get('reprogramming_num'),
|
||||
'default_programming_state': cloud_programming.get('programming_state'),
|
||||
'default_is_reprogramming': True if cloud_programming.get('programming_state') in ['已下发'] else False
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
confirm="是否确认更新程序"
|
||||
attrs="{'invisible': ['|',('state', '!=', 'rework'),('programming_state', '!=', '已编程未下发')]}"/>
|
||||
<button name="button_rework" string="返工" type="object" groups="sf_base.group_sf_mrp_user"
|
||||
attrs="{'invisible': ['|','|',('state', '!=', 'rework') ,('programming_state', '!=', '已编程'),('is_rework', '=', True)]}"/>
|
||||
attrs="{'invisible': ['|','|',('state', '!=', 'rework') ,('programming_state', 'not in', ('已编程', False)),('is_rework', '=', True)]}"/>
|
||||
<button name="button_scrap_new" string="报废" type="object"
|
||||
groups="sf_base.group_sf_mrp_user"
|
||||
attrs="{'invisible': ['|',('is_scrap', '=', False),('state','=','cancel')]}"/>
|
||||
|
||||
@@ -138,7 +138,10 @@ class ReworkWizard(models.TransientModel):
|
||||
lambda item: (item.route_id.name in work.name and item.process_parameters_id
|
||||
and item.process_parameters_id == work.surface_technics_parameters_id) or
|
||||
(item.route_id.name == work.name and item.panel
|
||||
and item.panel == work.processing_panel))
|
||||
and item.panel == work.processing_panel) or
|
||||
(item.route_id == work.routing_workcenter_id
|
||||
and not work.processing_panel
|
||||
and not work.surface_technics_parameters_id))
|
||||
if route:
|
||||
work_list = self.env['mrp.workorder'].json_workorder_str(self.production_id, route[0])
|
||||
work_list[2].update({'tag_type': '重新加工', 'sequence': 0})
|
||||
@@ -304,6 +307,8 @@ class ReworkWizard(models.TransientModel):
|
||||
if self.env.user.has_group('sf_base.group_sf_order_user'):
|
||||
panel_ids = []
|
||||
panel_arr = production_id.product_id.model_processing_panel
|
||||
if panel_arr is False:
|
||||
break
|
||||
for p in production_id.detection_result_ids.filtered(
|
||||
lambda ap1: ap1.handle_result == '待处理'):
|
||||
if p.processing_panel not in panel_arr:
|
||||
|
||||
Reference in New Issue
Block a user