跳至內容
選單
此問題已被標幟
2 回覆
1762 瀏覽次數

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')

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
10月 23
9062
1
9月 23
3431
1
5月 23
2404
2
4月 23
2975
1
3月 23
2353