Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
1763 Переглядів

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?

Аватар
Відмінити

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

Найкраща відповідь

Hi, 

You can rewrite the birth field in model inscription As

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

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
3
жовт. 23
9062
1
вер. 23
3431
1
трав. 23
2404
2
квіт. 23
2975
1
бер. 23
2353