Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 30 additions & 14 deletions pos_restaurant_receipt_usability/static/src/js/SplitBillScreen.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
/*
Copyright (C) 2024-Today: GRAP (http://www.grap.coop)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
@author: Sylvain LE GAL
@author: Quentin DUPONT
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/

odoo.define("pos_restaurant_receipt_usability.SplitBillScreen", function (require) {
"use strict";
odoo.define(
"pos_restaurant_receipt_usability.SplitBillScreenPatchReceipt",
function (require) {
"use strict";

const SplitBillScreen = require("pos_restaurant.SplitBillScreen");
const Registries = require("point_of_sale.Registries");
const SplitBillScreen = require("pos_restaurant.SplitBillScreen");
const {patch} = require("web.utils");
const Registries = require("point_of_sale.Registries");

const OverloadSplitBillScreen = (OriginalSplitBillScreen) =>
class extends OriginalSplitBillScreen {
render() {
// Link the new created order with the original one
this.newOrder.splitted_order = this.env.pos.get_order();
patch(
SplitBillScreen.prototype,
"pos_restaurant_split_order_usability.SplitBillScreenPatchReceipt",
{
/**
* Link the new created order with the original one
*/
proceed() {
if (this.newOrder) {
this.newOrder.splitted_order = this.env.pos.get_order();
}
if (this._super) {
this._super(...arguments);
}
},
}
};
Registries.Component.extend(SplitBillScreen, OverloadSplitBillScreen);
return SplitBillScreen;
});
);

Registries.Component.add(SplitBillScreen);
return SplitBillScreen;
}
);
Loading