优化返工代码
This commit is contained in:
@@ -63,11 +63,12 @@ class ReworkWizard(models.TransientModel):
|
|||||||
for panel in self.processing_panel_id:
|
for panel in self.processing_panel_id:
|
||||||
panel_workorder = self.production_id.workorder_ids.filtered(
|
panel_workorder = self.production_id.workorder_ids.filtered(
|
||||||
lambda ap: ap.processing_panel == panel.name and ap.state != 'rework')
|
lambda ap: ap.processing_panel == panel.name and ap.state != 'rework')
|
||||||
rework_clamp_workorder = max(panel_workorder.filtered(
|
|
||||||
lambda rp: rp.processing_panel == panel.name and rp.routing_type == '装夹预调' and rp.state in [
|
|
||||||
'done', 'rework']))
|
|
||||||
if panel_workorder:
|
if panel_workorder:
|
||||||
panel_workorder.write({'state': 'rework'})
|
panel_workorder.write({'state': 'rework'})
|
||||||
|
rework_clamp_workorder = max(panel_workorder.filtered(
|
||||||
|
lambda
|
||||||
|
rp: rp.processing_panel == panel.name and rp.routing_type == '装夹预调' and rp.state in [
|
||||||
|
'done', 'rework']))
|
||||||
# panel_workorder.filtered(
|
# panel_workorder.filtered(
|
||||||
# lambda wo: wo.routing_type == '装夹预调').workpiece_delivery_ids.filtered(
|
# lambda wo: wo.routing_type == '装夹预调').workpiece_delivery_ids.filtered(
|
||||||
# lambda wd: wd.status == '待下发').write({'status': '已取消'})
|
# lambda wd: wd.status == '待下发').write({'status': '已取消'})
|
||||||
|
|||||||
Reference in New Issue
Block a user