[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) <trj@odoo.com>
This commit is contained in:
pedrambiria
2022-05-24 14:51:19 +02:00
parent bb4a4ce740
commit c3030c3a7c
+1 -1
View File
@@ -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: