[FIX] hr_expense: Fix employee_id search domain

Fix a bug introduced where the search domain returned is a string instead of
a list on the employee_id

task-3358176

Part-of: odoo/odoo#130244
This commit is contained in:
Julien Alardot (jual)
2023-10-20 23:37:36 +00:00
parent 55e64beb47
commit d6f4bbf58c
+1 -1
View File
@@ -45,7 +45,7 @@ class Employee(models.Model):
res = [('id', '=', 0)] # Nothing accepted by domain, by default
if self.user_has_groups('hr_expense.group_hr_expense_user') or self.user_has_groups('account.group_account_user'):
res = "['|', ('company_id', '=', False), ('company_id', '=', company_id)]" # Then, domain accepts everything
res = ['|', ('company_id', '=', False), ('company_id', 'child_of', self.env.company.root_id.id)] # Then, domain accepts everything
elif self.user_has_groups('hr_expense.group_hr_expense_team_approver') and self.env.user.employee_ids:
user = self.env.user
employee = self.env.user.employee_id