Accept Merge Request #1815: (feature/制造功能优化 -> develop)
Merge Request: 调整工单状态改变逻辑 Created By: @马广威 Accepted By: @马广威 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1815?initial=true
This commit is contained in:
@@ -1087,7 +1087,8 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
if (workorder.production_id.production_type == '人工线下加工'
|
if (workorder.production_id.production_type == '人工线下加工'
|
||||||
and workorder.production_id.schedule_state == '已排'
|
and workorder.production_id.schedule_state == '已排'
|
||||||
and len(workorder.production_id.picking_ids.filtered(
|
and len(workorder.production_id.picking_ids.filtered(
|
||||||
lambda w: w.state not in ['done', 'cancel'])) == 0):
|
lambda w: w.state not in ['done', 'cancel'])) == 0
|
||||||
|
and workorder.production_id.programming_state == '已编程'):
|
||||||
if workorder.is_subcontract is True:
|
if workorder.is_subcontract is True:
|
||||||
purchase_orders_id = self._get_surface_technics_purchase_ids()
|
purchase_orders_id = self._get_surface_technics_purchase_ids()
|
||||||
if purchase_orders_id.state == 'purchase':
|
if purchase_orders_id.state == 'purchase':
|
||||||
|
|||||||
@@ -113,7 +113,11 @@ class SFSaleOrderCancelLine(models.TransientModel):
|
|||||||
'draft': '报价',
|
'draft': '报价',
|
||||||
'cancel': '已取消',
|
'cancel': '已取消',
|
||||||
'pass': '通过的',
|
'pass': '通过的',
|
||||||
'fail': '失败的'
|
'fail': '失败的',
|
||||||
|
'done': '已完成',
|
||||||
|
'rework': '返工',
|
||||||
|
'purchase': '采购订单',
|
||||||
|
'ready': '就绪'
|
||||||
}
|
}
|
||||||
|
|
||||||
# 检查销售订单
|
# 检查销售订单
|
||||||
@@ -313,7 +317,7 @@ class SFSaleOrderCancelLine(models.TransientModel):
|
|||||||
'product_name': check.product_id.name,
|
'product_name': check.product_id.name,
|
||||||
'quantity': 1,
|
'quantity': 1,
|
||||||
'doc_state': map_dict.get(check.quality_state, check.quality_state),
|
'doc_state': map_dict.get(check.quality_state, check.quality_state),
|
||||||
'cancel_reason': '已有异动' if check.quality_state not in ['none'] else ''
|
'cancel_reason': '已有异动' if check.quality_state not in ['none', 'cancel'] else ''
|
||||||
}
|
}
|
||||||
lines.append(self.create(vals))
|
lines.append(self.create(vals))
|
||||||
sequence += 1
|
sequence += 1
|
||||||
|
|||||||
Reference in New Issue
Block a user