From e7cb100ab1e2105c77d491c2a9c4983de39a2d4e Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Mon, 31 Mar 2025 15:55:37 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BC=98=E5=8C=96=E8=B0=83=E6=8B=A8?= =?UTF-8?q?=E5=8D=95=E9=AA=8C=E8=AF=81=E6=96=B9=E6=B3=95=EF=BC=9B2?= =?UTF-8?q?=E3=80=81=E9=9A=90=E8=97=8F=E8=AF=B7=E8=B4=AD=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E8=A7=86=E5=9B=BE=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/purchase_request_view.xml | 13 +++++++------ sf_stock/models/stock_picking.py | 10 ++++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/jikimo_purchase_request/views/purchase_request_view.xml b/jikimo_purchase_request/views/purchase_request_view.xml index db88a4e2..9976b52a 100644 --- a/jikimo_purchase_request/views/purchase_request_view.xml +++ b/jikimo_purchase_request/views/purchase_request_view.xml @@ -2,7 +2,7 @@ purchase.request.sf.form purchase.request - + 重置草稿 @@ -21,19 +21,20 @@ purchase.request.line.sf.tree purchase.request.line - + - + + True True - + 采购数量 @@ -44,7 +45,7 @@ - + @@ -52,7 +53,7 @@ purchase.request.line.sf.search purchase.request.line - + diff --git a/sf_stock/models/stock_picking.py b/sf_stock/models/stock_picking.py index 4623c4ed..d4453d51 100644 --- a/sf_stock/models/stock_picking.py +++ b/sf_stock/models/stock_picking.py @@ -88,6 +88,16 @@ class StockPicking(models.Model): self.send_to_bfm() return info + def _action_done(self): + """处理创建欠单时,新单据验证序列号无法使用问题""" + todo_moves = self.move_ids.filtered( + lambda self: self.state in ['draft', 'waiting', 'partially_available', 'assigned', 'confirmed']) + res = super(StockPicking, self)._action_done() + todo_move = todo_moves.filtered(lambda mv: mv.quantity_done == 0) + if todo_move: + todo_move.move_line_nosuggest_ids.write({'qty_done': 1}) + return res + def deal_move_ids(self, send_move_ids, send_move_line_ids): move_ids = [] # 本次发货单 move_line_ids = [] # 本次发货单行