[FIX] lunch: make sure that user has a last_lunch_location
We should have the frontend and backend in sync on the last_location of the user closes odoo/odoo#33608 Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
This commit is contained in:
@@ -93,7 +93,9 @@ class LunchController(http.Controller):
|
||||
'currency': {'symbol': currency.symbol, 'position': currency.position},
|
||||
})
|
||||
|
||||
user_location = user.last_lunch_location_id if user.last_lunch_location_id else request.env['lunch.location'].search([], limit=1)
|
||||
if not user.last_lunch_location_id:
|
||||
user.last_lunch_location_id = request.env['lunch.location'].search([], limit=1)
|
||||
user_location = user.last_lunch_location_id
|
||||
|
||||
alert_domain = expression.AND([
|
||||
[('available_today', '=', True)],
|
||||
|
||||
Reference in New Issue
Block a user