From c19268e584c60d6370bbbea0bad16da226c774b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Tue, 28 Apr 2026 16:02:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_stock/models/inherit_stock_picking.py | 14 ++++++++++++++ yuthon_stock/views/inherit_stock_picking.xml | 10 +++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/yuthon_stock/models/inherit_stock_picking.py b/yuthon_stock/models/inherit_stock_picking.py index f6259922c..7fa27d59b 100644 --- a/yuthon_stock/models/inherit_stock_picking.py +++ b/yuthon_stock/models/inherit_stock_picking.py @@ -683,6 +683,20 @@ class StockPicking(models.Model): self.receipt_status = 'certification' # 状态变为证明 return True + def action_reset_to_acceptance(self): + """管理员退回:清空验收信息,重新回到待转交验收节点""" + self.ensure_one() + if not self.env.user.has_group('base.group_system'): + raise UserError('只有系统管理员才能执行此操作!') + if self.state == 'done': + raise UserError('已完成入库的单据不能退回,如需撤销请联系技术人员!') + self.write({ + 'receipt_status': 'acceptance', + 'acceptance_user_id': False, + 'employee_id': False, + 'acceptance_date': False, + }) + def action_transfer_acceptance(self): """转交验收:弹出选人 wizard""" self.ensure_one() diff --git a/yuthon_stock/views/inherit_stock_picking.xml b/yuthon_stock/views/inherit_stock_picking.xml index 26944ca5c..d58b97781 100644 --- a/yuthon_stock/views/inherit_stock_picking.xml +++ b/yuthon_stock/views/inherit_stock_picking.xml @@ -87,6 +87,10 @@ invisible="picking_type_code != 'internal' or return_state != 'pending' or return_approver_id != uid"/>