From 0c97939165365927198539e8a02a93f2935964b5 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Sat, 8 Nov 2025 22:32:32 +0800 Subject: [PATCH] fix: bind_resignation bug --- apps/hrm/services.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/hrm/services.py b/apps/hrm/services.py index 0e94b687..e7405942 100755 --- a/apps/hrm/services.py +++ b/apps/hrm/services.py @@ -502,5 +502,12 @@ def bind_resignation(ticket: Ticket, transition: Transition, new_ticket_data: di ins = Resignation.objects.get(id=new_ticket_data['t_id']) if ins.ticket and ins.ticket.id != ticket.id: raise ParseError('重复创建工单') - ticket.create_by = ins.create_by - ticket.save() \ No newline at end of file + if ins.ticket is None: + ticket_data = ticket.ticket_data + ticket_data.update({ + 't_model': 'resignation', + 't_id': ins.id, + }) + ticket.ticket_data = ticket_data + ticket.create_by = ins.create_by + ticket.save() \ No newline at end of file