Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
1264 Visualizzazioni

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 ?

Avatar
Abbandona
Risposta migliore

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


Avatar
Abbandona