Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1209 Lượt xem

Hello,

I added a one2many in the model helpdesk.ticket and i want, when i click on the button "CREATE TASK" in the ticket form to pass this one2many.

I found that this button open a popup on the model helpdesk\.create\.fsm\.task also\ i\ added\ the\ same\ one2many\ in\ this\ model\ and\ try\ to\ pass\ the\ o2m\ from\ hepdesk\.ticket\ and\ to\ helpdesk\.create\.fsm\.task and\ then\ from\ helpdesk.create.fsm.task to project.task.


Is anybody knows how to do that ?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

I have the same problem, I used Automation and still I got the error. 

here is the code

# Get the helpdesk ticket related to the FSM task

ticket = record.ticket_id  # Replace 'ticket_id' with the actual field name if different


# Ensure the ticket exists and has the required field

if ticket and ticket.x_studio_many2one_field_JCxQu:

    # Update the FSM task with the value from the Helpdesk ticket field

    record.write({'x_studio_many2one_field_Eemgx': ticket.x_studio_many2one_field_JCxQu.id})


Ảnh đại diện
Huỷ bỏ