Hello everybody, basically I want to pre fill Formulario's fields with some specific values. Formulario is a class which is related with other class called "Paciente". With specific values I mean I want to create a new Formulario with the last entered values of a Formulario's record. Supose you have this case:
1 - Create a new Paciente
2 - Create a new Formulario and fill some fields
3 - Create other Formulario. Here I am trying to get the already filled fields filled. This is what I want to achieve.
That classes are defined as follows:
class Formulario(Workflow, ModelSQL,ModelView):
'Formulario'
_name = 'cefiro.formulario'
_description = __doc__
_rec_name = 'fecha'
paciente = fields.Many2One('cefiro.paciente','Paciente') # Don't understand why here is Many2One and the other was One2One
## Here I have more fields but I only put one here in order to simplify:
motivoPaciente1 = fields.Char(u'Motivo según el paciente (1)')
...
Formulario()
And the related class "Paciente" is declared as follows:
class Paciente(Persona,Workflow):
'Paciente'
_name = 'cefiro.paciente'
_description = __doc__
formularioInicial = fields.One2Many('cefiro.formulario', 'paciente', 'Formulario Inicial')
Thank you in advance