Skip to content

[FIX] hr_employee_catch_partner: When the partner of a employee was c…#11

Open
mikelarre wants to merge 3 commits intoavanzosc:8.0from
mikelarre:8.0
Open

[FIX] hr_employee_catch_partner: When the partner of a employee was c…#11
mikelarre wants to merge 3 commits intoavanzosc:8.0from
mikelarre:8.0

Conversation

@mikelarre
Copy link

…hanged the old one did not change the pointing to this employee, creating issues on contract assignations

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
Copy link
Contributor

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

@api.multi
def write(self, vals):
result = super(HrEmployee, self).write(vals)
if vals.get('address_home_id', False):
Copy link
Contributor

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

Copy link
Collaborator

@agaldona agaldona left a 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

mikelarre and others added 2 commits October 19, 2017 10:13
…hanged the old one did not change the pointing to this employee, creating issues on contract assignations
@coveralls
Copy link

coveralls commented Oct 19, 2017

Coverage Status

Coverage decreased (-0.4%) to 99.104% when pulling 53f5e4c on mikelarre:8.0 into 4face60 on avanzosc:8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants