Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
1757 Vizualizări

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?

Imagine profil
Abandonează

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

Cel mai bun răspuns

Hi, 

You can rewrite the birth field in model inscription As

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
3
oct. 23
9060
1
sept. 23
3430
1
mai 23
2402
2
apr. 23
2972
1
mar. 23
2352