Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
1186 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit