Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] sale_timesheet: fall back on user employee to find SO line
Versions: --------- - 16.3e+ Steps: ------ 1. Create an Sales Order with two lines that will create a task; 2. confirm and go to the new project's settings; 3. in Invoicing tab, link an employee to an SO item; 4. link yourself to the other item; 5. go to timesheets; 6. add a new line; 7. select the project and the task created for the other employee. Issue: ------ The SO item changes to the one linked to the other employee instead of the one linked to you in the project's settings. Cause: ------ The new `account.analytic.line` record doesn't have an `employee_id`, which `_compute_so_line` needs to accurately determine the sale line. In saas-16.2, the new record retrieved the `employee_id` from the view, which defaulted to the current user's, but these dissapeared at some point between saas-16.2 and saas-16.3 Solution: --------- Modify the `_timesheet_determine_sale_line` method can be modified to compare `map_entry.employee_id` on `self.employee_id` or `self.env.user.employee_id` instead of only `self.employee_id`. This approach is already used in caace8a to fix a similar bug. opw-3641939 closes odoo#148493 X-original-commit: 0802f35 Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com> Signed-off-by: Levi Siuzdak <sile@odoo.com>
- Loading branch information