Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
6789 Lượt xem

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")
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
9
thg 6 23
13071
2
thg 1 22
3870
2
thg 12 21
7891
0
thg 6 21
1947
0
thg 2 21
2540