[FIX] project_timesheet_holidays: fix task_id field records when creating a timesheet
The fix done in 3b966c2f21 remove the `('company_id', '=', company_id)` in the domain of
task_id field defined in account.analytic.line in hr_timesheet, but that tuple
is reintroduced in `project_timesheet_holidays`.
This commit also removes that tuple to be sure we will no longer have that
tuple used in the domain of task_id field for timesheets.
To reproduce the issue, follow these steps:
1. Install project_timesheet_holidays module.
2. From the settings menu, create a new company.
3. enter in multi-company mode by keeping the current one as active and
check the other company in companies switcher.
3. Create a project using the newly created company(e.g. New Company) and add
a task to it.
4. Open the Timesheet application and create a new timesheet.
5. In the timesheet, select the project created in step 3, and observe that the
dropdown for tasks does not display any task.
Current behavior:
----------------
The user cannot select a task in another company than the current one.
Expected behavior:
-----------------
The user should be able to select the task in the another company if he
is in multi-company mode.
task-3323027
closes odoo/odoo#131870
X-original-commit: d630711e795e7eddeb7b0ec47920f288920aedc6
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit is contained in:
@@ -10,8 +10,7 @@ class AccountAnalyticLine(models.Model):
|
||||
|
||||
holiday_id = fields.Many2one("hr.leave", string='Time Off Request', copy=False)
|
||||
global_leave_id = fields.Many2one("resource.calendar.leaves", string="Global Time Off", ondelete='cascade')
|
||||
task_id = fields.Many2one(domain="[('company_id', '=', company_id), ('project_id.allow_timesheets', '=', True),"
|
||||
"('project_id', '=?', project_id), ('is_timeoff_task', '=', False)]")
|
||||
task_id = fields.Many2one(domain="[('project_id.allow_timesheets', '=', True), ('project_id', '=?', project_id), ('is_timeoff_task', '=', False)]")
|
||||
|
||||
def _get_redirect_action(self):
|
||||
leave_form_view_id = self.env.ref('hr_holidays.hr_leave_view_form').id
|
||||
|
||||
Reference in New Issue
Block a user