Skip to content
Snippets Groups Projects
Commit 48151984 authored by Pedram (PEBR)'s avatar Pedram (PEBR)
Browse files

[FIX] pos_restaurant: Avoid error when order table is deleted


When an order's associated table is deleted, the POS tries to load the
table name to display in the order list. This results in an error if
the table no longer exists.

To prevent this, only display the table name if the table still exists
for the order. This avoids the error when trying to load a deleted
table.

opw-3509678

closes odoo/odoo#135970

Signed-off-by: default avatarJoseph Caburnay (jcb) <jcb@odoo.com>
parent 7d10b170
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,8 @@ odoo.define('pos_restaurant.TicketScreen', function (require) {
});
}
getTable(order) {
return `${order.getTable().floor.name} (${order.getTable().name})`;
const table = order.getTable();
return table ? `${table.floor.name} (${table.name})` : '';
}
//@override
_getSearchFields() {
......
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