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:
@@ -1100,7 +1100,16 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
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):
|
||||||
workorder.state = 'ready'
|
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
|
continue
|
||||||
# ================= 如果制造订单刀具状态为[无效刀、缺刀] 或者 制造订单状态为[返工]==========================
|
# ================= 如果制造订单刀具状态为[无效刀、缺刀] 或者 制造订单状态为[返工]==========================
|
||||||
if (workorder.production_id.tool_state in ['1', '2'] or workorder.production_id.state == 'rework'
|
if (workorder.production_id.tool_state in ['1', '2'] or workorder.production_id.state == 'rework'
|
||||||
|
|||||||
@@ -701,7 +701,7 @@ class StockPicking(models.Model):
|
|||||||
moves_out.write(
|
moves_out.write(
|
||||||
{'picking_id': picking_out.id, 'state': 'waiting'})
|
{'picking_id': picking_out.id, 'state': 'waiting'})
|
||||||
moves_out._assign_picking_post_process(new=new_picking)
|
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')
|
@api.depends('move_type', 'immediate_transfer', 'move_ids.state', 'move_ids.picking_id')
|
||||||
def _compute_state(self):
|
def _compute_state(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user