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

As u can see, i have a field name "email", and i want it will link with the field name "work_email" in "hr.employee" so i can choose what email i want to set new password, what should i do now? Anybody help me

This is my py file:

class change_password(models.Model):
_name = "change_password"
email = fields.Char(string="Your Email")
old_password = fields.Char(string="Input your old password", password = "True")
new_password = fields.Char(string="Your New Password", password = "True")
頭像
捨棄
最佳答案

Hello,

Try to know the functionality of related field.

class change_password(models.Model):
_name = "change_password"
    hr_email = fields.Many2one('hr.employee', string='Email', ondelete='cascade', index=True)
    old_password = fields.Char(related='hr_email.password', string="Input your old password", password = "True")

 

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
9
6月 23
13056
2
1月 22
3862
2
12月 21
7886
0
6月 21
1937
0
2月 21
2533