[FIX] website_sale: fix list view button

The legacy RPC was removed in 7422eb6 and replaced by `rpc_service`. The
changes to adapt the list view button on the `/shop` pages did not work.

This commit will use `rpc_service` instead of `this.rpc` which is not instantiated.

closes odoo/odoo#133064

Related: odoo/enterprise#46252
Related: odoo/upgrade#5190
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
Valentin Chevalier
2023-10-10 17:26:31 +00:00
parent 0750eb6315
commit 1f29d4c45c
@@ -9,6 +9,7 @@ import "@website/libs/zoomodoo/zoomodoo";
import {extraMenuUpdateCallbacks} from "@website/js/content/menu";
import dom from "@web/legacy/js/core/dom";
import { ProductImageViewer } from "@website_sale/js/components/website_sale_image_viewer";
import { jsonrpc } from "@web/core/network/rpc_service";
import { debounce, throttleForAnimation } from "@web/core/utils/timing";
import { listenSizeChange, SIZES, utils as uiUtils } from "@web/core/ui/ui_service";
@@ -759,7 +760,7 @@ publicWidget.registry.WebsiteSaleLayout = publicWidget.Widget.extend({
var clickedValue = $(ev.target).val();
var isList = clickedValue === 'list';
if (!this.editableMode) {
this.rpc('/shop/save_shop_layout_mode', {
jsonrpc('/shop/save_shop_layout_mode', {
'layout_mode': isList ? 'list' : 'grid',
});
}