Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
1758 Visualizzazioni

supprose i have this 2 class: 


class Personne(models.Model):

    _name = "personne"

    

name = fields.Char(string="name")

birth = fields.Date(string="Birth date")

class inscription(models.Model):

    _name = "inscription"

    

    name = fields.Char(string="Date")

personne = fields.Many2one('personne', string='Personne')

    birth = fields.Many2one('personne', string='Birth date')

in class "inscription" the value of birth should be related to shoosed personne

how can i set birth value automaticaly after personne choosed?

Avatar
Abbandona

Odoo Customization Tips: https://goo.gl/8HgnCF

Risposta migliore

Hi, 

You can rewrite the birth field in model inscription As

birth = fields.Date(string="Birth date", related='personne.birth')

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
3
ott 23
9060
1
set 23
3430
1
mag 23
2402
2
apr 23
2972
1
mar 23
2352