Skip to content
Snippets Groups Projects
Commit c3030c3a authored by pedrambiria's avatar pedrambiria
Browse files

[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: 822d444f
Signed-off-by: default avatarTrinh Jacky (trj) <trj@odoo.com>
parent bb4a4ce7
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment