From ca1b0921d68c36893ccfdece1ef1b65b9ceaa04d Mon Sep 17 00:00:00 2001 From: "David Monnom (moda)" Date: Fri, 23 Feb 2024 16:26:03 +0100 Subject: [PATCH] [IMP] pos_restaurant: improve preparation display functionality Behavior before the changes: - When a note was modified, it cancelled the old orderline and recreated it with the new note. - Products were not sorted by category in the order preparation display. - Clicking on the header of an order sent it directly to the next stage, regardless of whether lines were crossed out or not. - There were brackets around the order number. Behavior after changes: - When a note is modified, it is modified directly on the existing orderline. - Products are now sorted by category in the order. - Clicking on an order header sends only the crossed-out lines to the next stage. If no line is crossed out, the entire order is sent. - There are no longer any brackets around the order name. taskId: 3764317 enterprise PR: https://github.com/odoo/enterprise/pull/57385 closes odoo/odoo#155246 Related: odoo/enterprise#57385 Signed-off-by: Adrien Guilliams (adgu) --- .../orderline_note_button/orderline_note_button.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/pos_restaurant/static/src/app/control_buttons/orderline_note_button/orderline_note_button.js b/addons/pos_restaurant/static/src/app/control_buttons/orderline_note_button/orderline_note_button.js index 31e7d0009d9..f686a9fe97c 100644 --- a/addons/pos_restaurant/static/src/app/control_buttons/orderline_note_button/orderline_note_button.js +++ b/addons/pos_restaurant/static/src/app/control_buttons/orderline_note_button/orderline_note_button.js @@ -22,6 +22,7 @@ export class OrderlineNoteButton extends Component { return; } + const oldNote = this.selectedOrderline.getNote(); const { confirmed, payload: inputNote } = await this.popup.add(TextAreaPopup, { startingValue: this.selectedOrderline.getNote(), title: _t("Add internal Note"), @@ -30,6 +31,8 @@ export class OrderlineNoteButton extends Component { if (confirmed) { this.selectedOrderline.setNote(inputNote); } + + return { confirmed, inputNote, oldNote }; } }