Skip to content

Commit 0b79d70

Browse files
committed
Restrict table transfer between different rooms
1 parent d9c781a commit 0b79d70

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ury/ury/doctype/ury_order/ury_order.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,10 @@ def table_transfer(table, newTable, invoice):
358358
pos_invoice = frappe.get_doc("POS Invoice", invoice)
359359
new_table = frappe.get_doc("URY Table", newTable)
360360

361-
if new_table.occupied == 1:
361+
if (
362+
current_table.restaurant_room == new_table.restaurant_room
363+
and new_table.occupied == 1
364+
):
362365
frappe.throw(f"Table {new_table.name} is already occupied")
363366

364367
# Update table status
@@ -386,6 +389,9 @@ def table_transfer(table, newTable, invoice):
386389
# If an exception occurs (e.g., "kot" app not found), it will be caught here without effecting execution
387390
pass
388391

392+
else:
393+
frappe.throw(_("Table transfer between different rooms is restricted."))
394+
389395

390396
@frappe.whitelist()
391397
def captain_transfer(currentCaptain, newCaptain, invoice):

0 commit comments

Comments
 (0)