Accept Merge Request #1602: (feature/sale_order_route_pick -> develop)

Merge Request: 特殊表面工艺工单没有完成对应采购单时工单处于等待组件

Created By: @胡尧
Accepted By: @胡尧
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1602?initial=true
This commit is contained in:
胡尧
2024-12-05 13:42:33 +08:00
committed by Coding
2 changed files with 11 additions and 2 deletions

View File

@@ -1100,6 +1100,15 @@ class ResMrpWorkOrder(models.Model):
and workorder.production_id.schedule_state == '已排'
and len(workorder.production_id.picking_ids.filtered(
lambda w: w.state not in ['done', 'cancel'])) == 0):
if workorder.is_subcontract is True:
purchase_orders_id = self._get_surface_technics_purchase_ids()
if purchase_orders_id.state == 'purchase':
workorder.state = 'ready'
continue
else:
workorder.state = 'waiting'
continue
else:
workorder.state = 'ready'
continue
# ================= 如果制造订单刀具状态为[无效刀、缺刀] 或者 制造订单状态为[返工]==========================

View File

@@ -701,7 +701,7 @@ class StockPicking(models.Model):
moves_out.write(
{'picking_id': picking_out.id, 'state': 'waiting'})
moves_out._assign_picking_post_process(new=new_picking)
return moves_in, moves_out
@api.depends('move_type', 'immediate_transfer', 'move_ids.state', 'move_ids.picking_id')
def _compute_state(self):