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
})
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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
})
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
})
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up