From 166a63455ebc6d487ba864810e4ce70e74763a2e Mon Sep 17 00:00:00 2001 From: Daniel Duque Date: Mon, 21 Oct 2024 13:32:13 +0200 Subject: [PATCH] [FIX] pos_order_to_sale_order: rpc helper `rpc` attribute used comes from LegacyComponent, that is deprecated and throws an error in some specific cases. Changing it by `this.env.services` works properly in all cases. --- .../static/src/js/CreateOrderPopup.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pos_order_to_sale_order/static/src/js/CreateOrderPopup.js b/pos_order_to_sale_order/static/src/js/CreateOrderPopup.js index 0bf14440d3..3b8a6afc52 100644 --- a/pos_order_to_sale_order/static/src/js/CreateOrderPopup.js +++ b/pos_order_to_sale_order/static/src/js/CreateOrderPopup.js @@ -43,11 +43,12 @@ odoo.define("point_of_sale.CreateOrderPopup", function (require) { async _createSaleOrder(order_state) { const current_order = this.env.pos.get_order(); framework.blockUI(); - return await this.rpc({ - model: "sale.order", - method: "create_order_from_pos", - args: [current_order.export_as_JSON(), order_state], - }) + return await this.env.services + .rpc({ + model: "sale.order", + method: "create_order_from_pos", + args: [current_order.export_as_JSON(), order_state], + }) .catch(function (error) { throw error; })