Skip to content

Commit

Permalink
[IMP] pos_restaurant: auto-create floating order from quick table sel…
Browse files Browse the repository at this point in the history
…ector

Before this commit:
====================
If the number entered on the quick table selector numpad did not match any
existing table or floating order, an error message ("No table or floating order
found with this number") was displayed.

After this commit:
==================
When the entered number does not correspond to an existing table or floating
order, a new floating order is automatically created using the inputted number.

task- 4274465

closes odoo#187474

X-original-commit: f924488
Related: odoo/enterprise#73951
Signed-off-by: David Monnom (moda) <[email protected]>
Signed-off-by: Jitendra Kumar Prajapat (jipr) <[email protected]>
  • Loading branch information
jipr-odoo committed Nov 18, 2024
1 parent 9a9320c commit 3b2a26c
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Navbar } from "@point_of_sale/app/components/navbar/navbar";
import { patch } from "@web/core/utils/patch";
import { _t } from "@web/core/l10n/translation";
import { AlertDialog } from "@web/core/confirmation_dialog/confirmation_dialog";
import { getButtons, EMPTY, ZERO, BACKSPACE } from "@point_of_sale/app/components/numpad/numpad";
import { TableSelector } from "./table_selector/table_selector";

Expand Down Expand Up @@ -69,11 +68,10 @@ patch(Navbar.prototype, {
return this.setFloatingOrder(floating_order);
}
if (!table && !floating_order) {
this.dialog.add(AlertDialog, {
title: _t("Error"),
body: _t("No table or floating order found with this number"),
});
return;
const newOrder = this.pos.add_new_order();
newOrder.floating_order_name = table_number;
newOrder.setBooked(true);
return this.setFloatingOrder(newOrder);
}
},
});
Expand Down

0 comments on commit 3b2a26c

Please sign in to comment.