Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
1761 Tampilan

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
Buang

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

Jawaban Terbai

Hi, 

You can rewrite the birth field in model inscription As

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

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
3
Okt 23
9062
1
Sep 23
3431
1
Mei 23
2404
2
Apr 23
2974
1
Mar 23
2353