Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
1776 Zobrazení

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
Zrušit

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

Nejlepší odpověď

Hi, 

You can rewrite the birth field in model inscription As

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
říj 23
9075
1
zář 23
3431
1
kvě 23
2406
2
dub 23
2979
1
bře 23
2357