出入库单状态修复
This commit is contained in:
@@ -434,6 +434,12 @@ class ResMrpWorkOrder(models.Model):
|
||||
def button_start(self):
|
||||
if self.routing_type == '装夹':
|
||||
self.pro_code = self.production_id.move_raw_ids[0].move_line_ids[0].lot_id.name
|
||||
# 外协出库单,从“正在等待”变为“就绪”状态
|
||||
if self.is_subcontract is True:
|
||||
picking_out = self.env['stock.picking'].search([('id', '=', self.picking_out_id.id)])
|
||||
if picking_out:
|
||||
if picking_out.state == 'confirmed':
|
||||
picking_out.write({'state': 'assigned'})
|
||||
if self.state == 'waiting' or self.state == 'ready' or self.state == 'progress':
|
||||
self.move_raw_ids = self.production_id.move_raw_ids
|
||||
self.ensure_one()
|
||||
@@ -479,11 +485,6 @@ class ResMrpWorkOrder(models.Model):
|
||||
if self.date_planned_finished and self.date_planned_finished < start_date:
|
||||
vals['date_planned_finished'] = start_date
|
||||
return self.write(vals)
|
||||
# 外协出库单,从“正在等待”变为“就绪”状态
|
||||
if self.is_subcontract is True:
|
||||
picking_out = self.env['stock.picking'].search([('id', '=', self.picking_out_id.id)])
|
||||
if picking_out:
|
||||
picking_out.write({'state': 'assigned'})
|
||||
else:
|
||||
raise UserError(_('请先完成上一步工单'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user