Hi,
I have 3 models ; I want to use context to get default values when passing from view to other . How can I do that ? Any help please ?
When creating patient , I will choose or create an appointment. I would to get value "patient_id" of the model 'hospital.rdv' by default .
Also I have a button action to create an operation from 'hospital.patient' model, so , fields 'date' , 'patient_name ' must be by default.
class Hospital(models.Model):
_name = 'hospital.patient'
patient_id = fields.Many2one(hospital.rdv)
class Rendez-vous(models.Model):
_name = 'hospital.rdv'
hospital_rdv_id = fields.Many2one(training.patient_id)
Date = fields.Date(string="Date")
patient_name = fields.Char(string="Name")
class Operation(models.Model):
_name = 'hospital.operation'
patient_id = fields.Many2one(hospital.rdv)
Date = fields.Date(string="Date")
patient_name = fields.Char(string="Name")
Thanks.