Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
344 Vizualizări

I am creating a js file that inherits from spreadsheet/static/src/o_spreadsheet/o_spreadsheet.js. I am trying to override the onMessageReceived(message) function of the "Session" class in that file. But I am getting the error as shown.

Here is my code:

import { patch } from "@web/core/utils/patch";

import { Session } from "@spreadsheet/o_spreadsheet/o_spreadsheet";


console.log("Loading file successfull")

patch(Session.prototype, {

onMessageReceived(message) {

console.log("Successfully")

this._super(message);

if (message.type === "REQUIRE_RELOAD") {

window.location.reload();

}

},

});

file __manifest__.py:

'assets': {

'web.assets_backend': [

'spreadsheet_edition_extend/static/src/o_spreadsheet/o_spreadsheet.js',

],

},

Imagine profil
Abandonează
Cel mai bun răspuns

Hi,


Please make sure you have 'spreadsheet' in the depends in the manifest and also make sure you have added the paths in the correct asset bundle as shown below:


'depends': ['spreadsheet'],

'assets': {

       'spreadsheet.o_spreadsheet': ['

           'spreadsheet_edition_extend/static/src/o_spreadsheet/o_spreadsheet.js',

        ],

}


Hope it helps

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
mai 24
1459
1
iul. 25
1866
1
iul. 25
1127
4
mai 25
2588
2
mai 25
5973