Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
1760 Weergaven

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
Annuleer

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

Beste antwoord

Hi, 

You can rewrite the birth field in model inscription As

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

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
3
okt. 23
9060
1
sep. 23
3431
1
mei 23
2403
2
apr. 23
2974
1
mrt. 23
2353