Hi all,
I looked around but couldn't really find the full answer. I created two fields: x_studio_firstname and x_studio_lastname. Now, I need to combine these two into the x_studio_fullname field.
I believe I have the code to do this but don't know where to put it in Odoo to fully test it.
I read somewhere that I could change the complete_name field so that this field is generated with the custom fields. But again, I have no clue where to edit this in Odoo. Can someone point me in the right direction or provide documentation?
def name_get(self):
res = []
for record in self:
name = record.x_studio_Firstname + ' ' + record.x_studio_lastname
res.append((record.id, name))
return res
x_studio_fullname = fields.Char(string="Full Name", compute='_compute_full_name', store=True)
@api.depends('x_studio_Firstname', 'x_studio_lastname')
def _compute_full_name(self):
for record in self:
record.x_studio_fullname = record.x_studio_Firstname + ' ' + record.x_studio_lastname
Would it not be easier to customize the emails and/or reports to show full name? I can't imagine your back end Users need to see the full name?
That's just it. We don't need the full name in emails or contact with customers, only the first name. If we use the standard Odoo name field, it's the full name. So we could only use that for the first name and add a last name studio field. But that doesn't seem very handy to have a contact overview to show the full name. I added the extra field in the contact layout (via studio) but that doesn't really work. We need separate fields for the first and last name and show the full name via those fields. We thought it was basic, but it seems in Odoo that this isn't standard.