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"/>