Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
6765 Ansichten

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")
Avatar
Verwerfen
Beste Antwort

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

 

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
9
Juni 23
13054
2
Jan. 22
3861
2
Dez. 21
7884
0
Juni 21
1936
0
Feb. 21
2532