I have patient model as following :
class Patient(models.Model):
_name = "patient"
_description = "Details of patient"
_rec_name = 'patient_name'
patient_name = fields.Reference([('human.name', 'Full Name')], string="Patient's Name")
i have human name model as follows:
from odoo import models,fields,api
class HumanName(models.Model):
_name = 'human.name'
_description = 'Human name'
text = fields.Char(
string="Full Name",
help="A full text representation of the human name.",invisible=True)
family = fields.Char(
string="Family Name",
help="Family name (often called 'Surname')")
how to create a value for patient_name field using odoo controller ?