Skip to Content
Menu
This question has been flagged
1 Reply
1490 Views

How can I make x_name field automated show the name showing in many to one field instead of res.partner

My code was:


If not record.x_name:

  record.write({

       ‘x_name’ : record.x_studio_employee

  })

Avatar
Discard
Best Answer

You should go one step further in the model. So either name or display_name. 
Depending on the available fields
Or if it is a many2one field you want the id.

If not record.x_name:

  record.write({

       ‘x_name’ : record.x_studio_employee.id

  })

or 

  record.write({

       ‘x_name’ : record.x_studio_employee.name 

  })


Avatar
Discard