odoo
odoo copied to clipboard
[FIX] pos_restaurant: deleted order is accessible
Steps to reproduce
- Open restaurant.
- In a different tab, delete the order in table 1.
- In the opened restaurant, open table 1.
- [ISSUE 1] the table has an order.
- [ISSUE 2] try paying the order, you get a server error:
Record does not exist or has been deleted. (Record: pos.order(11,), User: 2)
Fix description
The issue is caused by not removing the locally created order if its corresponding record in the server is already paid. So in this commit, we check if the local order can be deleted or not by checking its copy in the server.