Accept Merge Request #2116: (feature/tool_standard_library_process -> 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/2116
This commit is contained in:
@@ -1383,7 +1383,16 @@ class ResMrpWorkOrder(models.Model):
|
||||
boolean = True
|
||||
if not boolean:
|
||||
raise UserError('制造订单【%s】缺少组件的序列号信息!' % self.production_id.name)
|
||||
self.pro_code = self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name
|
||||
self.pro_code = False # 默认值
|
||||
if (
|
||||
self.production_id
|
||||
and self.production_id.move_raw_ids
|
||||
and len(self.production_id.move_raw_ids) > 0
|
||||
and self.production_id.move_raw_ids[0].move_line_ids
|
||||
and len(self.production_id.move_raw_ids[0].move_line_ids) > 0
|
||||
and self.production_id.move_raw_ids[0].move_line_ids[0].lot_id
|
||||
):
|
||||
self.pro_code = self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name
|
||||
# cnc校验
|
||||
if self.production_id.production_type == '自动化产线加工':
|
||||
cnc_workorder = self.search(
|
||||
|
||||
@@ -126,7 +126,7 @@ class PurchaseOrder(models.Model):
|
||||
if not work_ids:
|
||||
continue
|
||||
min_sequence_wk = min(work_ids, key=lambda wk: wk.sequence)
|
||||
if min_sequence_wk.is_subcontract:
|
||||
if min_sequence_wk.is_subcontract and min_sequence_wk.state == 'ready':
|
||||
picking_id = production_id.picking_ids.filtered(
|
||||
lambda wk: wk.location_id.name == '制造前' and wk.location_dest_id.name == '外协加工区')
|
||||
move_out = picking_id.move_ids
|
||||
|
||||
Reference in New Issue
Block a user