调拨单就绪问题处理

This commit is contained in:
liaodanlong
2025-05-12 14:55:19 +08:00
parent 89e23050e6
commit ed50d7c9a7
2 changed files with 4 additions and 3 deletions

View File

@@ -1312,6 +1312,7 @@ class ResMrpWorkOrder(models.Model):
else:
workorder.state = 'ready'
continue
continue
# ================= 如果制造订单刀具状态为[无效刀、缺刀] 或者 制造订单状态为[返工]==========================
if (workorder.production_id.tool_state in ['1', '2'] or workorder.production_id.state == 'rework'
or workorder.production_id.schedule_state != '已排'
@@ -1327,9 +1328,7 @@ class ResMrpWorkOrder(models.Model):
if workorder.is_subcontract is False:
workorder.state = 'ready'
else:
if len(workorder.production_id.picking_ids.filtered(
lambda w: w.state not in ['done',
'cancel'])) == 0 and workorder.production_id.programming_state == '已编程':
if workorder.production_id.programming_state == '已编程':
purchase_orders_id = self._get_surface_technics_purchase_ids()
if purchase_orders_id:
if purchase_orders_id.state == 'purchase':

View File

@@ -152,6 +152,8 @@ class PurchaseOrder(models.Model):
for line in self.order_line:
# 将产品不追踪序列号的行项目设置qty_done
if not line.move_ids:
continue
if line.move_ids[0].product_id.tracking == 'none':
line.move_ids[0].quantity_done = line.move_ids[0].product_qty
return res