-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] hr_employee_catch_partner: When the partner of a employee was c… #11
base: 8.0
Are you sure you want to change the base?
Conversation
other_employee = self.search( | ||
[('address_home_id', '=', self.address_home_id.id), | ||
('id', '!=', self.id)], limit=1) | ||
self.address_home_id.employee_id = other_employee or False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Habría que tener en cuenta cuando no hay previamente "self.address_home_id" que es lo que realmente está fallando
@@ -27,8 +27,11 @@ def create(self, vals): | |||
|
|||
@api.multi | |||
def write(self, vals): | |||
result = super(HrEmployee, self).write(vals) | |||
if vals.get('address_home_id', False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
De esta manera cuando "quitas" el address_home_id del empleado no está eliminando el empleado del partner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM Ten en cuenta los puntos que te comenta @oihane
…hanged the old one did not change the pointing to this employee, creating issues on contract assignations
…hanged the old one did not change the pointing to this employee, creating issues on contract assignations