Skip to content

Commit

Permalink
[FIX] pos_order_to_sale_order: rpc helper
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
danielduqma committed Oct 21, 2024
1 parent e779233 commit 166a634
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pos_order_to_sale_order/static/src/js/CreateOrderPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
})
Expand Down

0 comments on commit 166a634

Please sign in to comment.