From 36e98afb4fd16e61e7dd5ade182ece67a94944ba Mon Sep 17 00:00:00 2001 From: MerlinGuillaume Date: Mon, 9 Oct 2023 13:53:34 +0000 Subject: [PATCH] [FIX] hr_expense: use correct employee model according to user group MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A traceback occurs when clicking on Search More in the employee field of expense if the user has no rights on employee Steps to reproduce: 1. Install Expenses 2. Go to Settings > General Settings > Users and click on Manage Users 3. Open user Mitchell Admin and remove all access rights on Employees 4. Go to Expenses and create a new expense 5. Click in the employee field, then on "Search More..." in the dropdown 6. An error occurs Solution: Depending on the group of the user, use 'hr.employee' or 'hr.employee.public' as done in https://github.com/odoo/odoo/commit/41eaff0f4c172a6018b0c8d9518d521c3832ef94 opw-3473418 closes odoo/odoo#138539 X-original-commit: 5d842587090b684786c3279d1ebe962ae57021b7 Signed-off-by: William André (wan) Signed-off-by: Guillaume Merlin (megu) --- addons/hr_expense/views/hr_expense_views.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/hr_expense/views/hr_expense_views.xml b/addons/hr_expense/views/hr_expense_views.xml index ee92629ccb2..992b2655150 100644 --- a/addons/hr_expense/views/hr_expense_views.xml +++ b/addons/hr_expense/views/hr_expense_views.xml @@ -201,9 +201,10 @@ options="{'no_create': True}"/> - + + + +