From c3030c3a7c5e841b99188b574ced9459d8e5e9e9 Mon Sep 17 00:00:00 2001 From: pedrambiria Date: Mon, 23 May 2022 14:03:00 +0000 Subject: [PATCH] [FIX] pos_restaurant: get table draft orders without employee Before this commit: In the PoS Restaurant, if the employee is not installed, the orders wouldn't contain employee_id, and UI couldn't get table draft orders. Steps to reproduce the first issue: - Install the' Point of Sale' module - Make sure Employees (hr) isn't installed - Create a PoS with "Is a Bar/Restaurant" enabled - Open a PoS session in the incognito window - Add the product to the orders for different tables - Close the incognito window and open it again It couldn't get table draft orders from the back-end. Solution It must check that "employee_id" exist in the dictionary. opw-2856653 closes odoo/odoo#92157 X-original-commit: 822d444f74edf8dd9bae7a01d3646e0888128901 Signed-off-by: Trinh Jacky (trj) --- addons/pos_restaurant/models/pos_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/pos_restaurant/models/pos_order.py b/addons/pos_restaurant/models/pos_order.py index 25cfd42d3fc..cf4c633ae87 100644 --- a/addons/pos_restaurant/models/pos_order.py +++ b/addons/pos_restaurant/models/pos_order.py @@ -182,7 +182,7 @@ class PosOrder(models.Model): order['partner_id'] = order['partner_id'][0] if order['table_id']: order['table_id'] = order['table_id'][0] - if order['employee_id']: + if 'employee_id' in order: order['employee_id'] = order['employee_id'][0] if order['employee_id'] else False if not 'lines' in order: