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:
马广威
2025-02-17 17:35:57 +08:00
committed by Coding
2 changed files with 8 additions and 3 deletions

View File

@@ -1087,7 +1087,8 @@ class ResMrpWorkOrder(models.Model):
if (workorder.production_id.production_type == '人工线下加工'
and workorder.production_id.schedule_state == '已排'
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:
purchase_orders_id = self._get_surface_technics_purchase_ids()
if purchase_orders_id.state == 'purchase':

View File

@@ -113,7 +113,11 @@ class SFSaleOrderCancelLine(models.TransientModel):
'draft': '报价',
'cancel': '已取消',
'pass': '通过的',
'fail': '失败的'
'fail': '失败的',
'done': '已完成',
'rework': '返工',
'purchase': '采购订单',
'ready': '就绪'
}
# 检查销售订单
@@ -313,7 +317,7 @@ class SFSaleOrderCancelLine(models.TransientModel):
'product_name': check.product_id.name,
'quantity': 1,
'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))
sequence += 1