修复成品调拨出库订单的状态没变
This commit is contained in:
@@ -654,7 +654,10 @@ class StockPicking(models.Model):
|
|||||||
if self.location_id.name == '成品存货区' and self.location_dest_id.name == '客户':
|
if self.location_id.name == '成品存货区' and self.location_dest_id.name == '客户':
|
||||||
sale_id = self.env['sale.order'].sudo().search(
|
sale_id = self.env['sale.order'].sudo().search(
|
||||||
[('name', '=', self.origin)])
|
[('name', '=', self.origin)])
|
||||||
if sale_id and res:
|
stock_picking_list = self.env['stock.picking'].sudo().search(
|
||||||
|
[('id', 'in', sale_id.picking_ids.ids)])
|
||||||
|
stock_picking = stock_picking_list.filtered(lambda p: p.state not in ("done", "cancel"))
|
||||||
|
if sale_id and not stock_picking:
|
||||||
sale_id.write({'state': 'delivered'})
|
sale_id.write({'state': 'delivered'})
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user