Accept Merge Request #1774: (feature/质检单优化_1 -> develop)
Merge Request: 处理制造订单再次返工时,点击返工按钮报错 Created By: @禹翔辉 Reviewed By: @马广威 Approved By: @马广威 Accepted By: @禹翔辉 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1774
This commit is contained in:
@@ -1256,9 +1256,9 @@ class MrpProduction(models.Model):
|
|||||||
'default_production_id': self.id,
|
'default_production_id': self.id,
|
||||||
'default_workorder_ids': workorder_ids.ids if workorder_ids.ids != [] else self.workorder_ids.ids,
|
'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_hidden_workorder_ids': ','.join(map(str, work_id_list)) if work_id_list != [] else '',
|
||||||
'default_reprogramming_num': cloud_programming.get('reprogramming_num'),
|
'default_reprogramming_num': cloud_programming.get('reprogramming_num') if cloud_programming else '',
|
||||||
'default_programming_state': cloud_programming.get('programming_state'),
|
'default_programming_state': cloud_programming.get('programming_state') if cloud_programming else '',
|
||||||
'default_is_reprogramming': True if cloud_programming.get('programming_state') in ['已下发'] else False
|
'default_is_reprogramming': True if cloud_programming and (cloud_programming.get('programming_state') in ['已下发']) else False
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -281,7 +281,8 @@ class ReworkWizard(models.TransientModel):
|
|||||||
{'programming_state': '编程中', 'work_state': '编程中', 'is_rework': True})
|
{'programming_state': '编程中', 'work_state': '编程中', 'is_rework': True})
|
||||||
# =================================================
|
# =================================================
|
||||||
if self.production_id.state == 'progress':
|
if self.production_id.state == 'progress':
|
||||||
self.production_id.write({'programming_state': '已编程', 'work_state': '已编程'})
|
if self.programming_state:
|
||||||
|
self.production_id.write({'programming_state': '已编程', 'work_state': '已编程'})
|
||||||
if self.reprogramming_num >= 1 and self.programming_state == '已编程':
|
if self.reprogramming_num >= 1 and self.programming_state == '已编程':
|
||||||
productions_not_delivered = self.env['mrp.production'].search(
|
productions_not_delivered = self.env['mrp.production'].search(
|
||||||
[('programming_no', '=', self.production_id.programming_no),
|
[('programming_no', '=', self.production_id.programming_no),
|
||||||
|
|||||||
Reference in New Issue
Block a user