From 8b40714daddc1f499dc7a6aa1e39e49bf20f543a Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Sat, 28 Dec 2024 14:55:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E4=BA=A4?= =?UTF-8?q?=E4=BB=98=E7=8A=B6=E6=80=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/stock.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index d43dc0b7..e0e0782f 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -657,11 +657,11 @@ class StockPicking(models.Model): if move_out: workorder = move_out.subcontract_workorder_id workorder.button_start() - # if self.location_id.name == '成品存货区' and self.location_dest_id == '客户': - # sale_id = self.env['sale.order'].sudo().search( - # [('name', '=', self.origin)]) - # if sale_id: - # sale_id.write({'state':'delivered'}) + if self.location_id.name == '成品存货区' and self.location_dest_id.name == '客户': + sale_id = self.env['sale.order'].sudo().search( + [('name', '=', self.origin)]) + if sale_id and all(move.product_uom_qty == move.quantity_done for move in self.move_ids): + sale_id.write({'state':'delivered'}) return res # 创建 外协出库入单