Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
1185 Widoki

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 ?

Awatar
Odrzuć
Najlepsza odpowiedź

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})


Awatar
Odrzuć