Skip to Content
मेन्यू
This question has been flagged
2 Replies
1783 Views

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
Discard

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

Best Answer

Hi, 

You can rewrite the birth field in model inscription As

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

Avatar
Discard
Related Posts Replies Views Activity
3
अक्तू॰ 23
9106
1
सित॰ 23
3433
1
मई 23
2415
2
अप्रैल 23
2989
1
मार्च 23
2362