From 9f94a4e06f82ca511f6b8daf48807ec5ff6c6caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Fri, 16 May 2025 11:44:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E8=B0=83=E6=8B=A8=E5=8D=95=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4=E7=94=9F=E6=88=90=E6=AC=A0=E5=8D=95=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=B9=E5=BA=94=E9=87=87=E8=B4=AD=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E6=98=8E=E7=BB=86=E8=A1=8C=E7=9A=84=E7=9B=AE=E6=A0=87?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_purchase_request/models/stock_picking.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/jikimo_purchase_request/models/stock_picking.py b/jikimo_purchase_request/models/stock_picking.py index d8f15f6b..85db247f 100644 --- a/jikimo_purchase_request/models/stock_picking.py +++ b/jikimo_purchase_request/models/stock_picking.py @@ -33,3 +33,13 @@ class StockPicking(models.Model): 'view_mode': 'tree,form', }) return action + + def _action_done(self): + res = super(StockPicking, self)._action_done() + # 将采购申请明细行的move_dest_ids设置为backorder_ids + backorder_ids = self.backorder_ids + if backorder_ids: + purchase_request_lines = self.move_ids.move_orig_ids.purchase_line_id.purchase_request_lines + if purchase_request_lines: + purchase_request_lines.move_dest_ids = [(4, x.id) for x in backorder_ids.move_ids] + return res \ No newline at end of file