Skip to Content
Menu
This question has been flagged
1 Atsakyti
6774 Rodiniai

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")
Portretas
Atmesti
Best Answer

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

 

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
9
birž. 23
13059
2
saus. 22
3864
2
gruod. 21
7886
0
birž. 21
1941
0
vas. 21
2537