From b5e3fd73eddcb75fa6ec246478907fe8c447684d Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Fri, 1 Oct 2021 13:22:41 +0000 Subject: [PATCH] [FIX] lunch: Don't erase lunch location when set closes odoo/odoo#77621 Signed-off-by: Yannick Tivisse (yti) --- addons/lunch/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/lunch/controllers/main.py b/addons/lunch/controllers/main.py index 64350af21ea..bda50e6f5ec 100644 --- a/addons/lunch/controllers/main.py +++ b/addons/lunch/controllers/main.py @@ -103,7 +103,7 @@ class LunchController(http.Controller): has_multi_company_access = not user_location.company_id or user_location.company_id.id in request._context.get('allowed_company_ids', request.env.company.ids) if not user_location or not has_multi_company_access: - user.last_lunch_location_id = user_location = request.env['lunch.location'].search([], limit=1) + user.last_lunch_location_id = user_location = request.env['lunch.location'].search([], limit=1) or user_location alert_domain = expression.AND([ [('available_today', '=', True)],