Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
2836 Visualizzazioni

hi everyone,
I am new in odoo 16 I have two buttons in portal, and when click on button then open wizard using js code, it's works fine in odoo 14 I think this js file is not work in odoo 16

odoo.define('vendor_portal_management.vendor_portal', function(require) {

'use strict';


var core = require('web.core');

var ajax = require('web.ajax');

var Dialog = require('web.Dialog');

var qweb = core.qweb;

var rpc = require("web.rpc");

var _t = core._t;

var session = require('web.session');


ajax.loadXML('/vendor_portal_management/static/src/xml/vendor_portal.xml', qweb);


$('document').ready(function () {

// Import Products and Prices

$('.import_prices_vp').on('click', function (ev) {

rpc.query({

model: 'vendor.product',

method: 'return_import_configs',

context: session.user_context,

}).then(function(values) {

var select = new VendorProductImportPrices(this, {}, values);

var def = $.Deferred();

select.on('save', this, function (root) {

def.resolve(root);

});

select.open();

});

});

// Product Create

$('.create_product_vp').on('click', function (ev) {

var select = new VendorProductDialogCreate(this, {}, {});

var def = $.Deferred();

select.on('save', this, function (root) {

def.resolve(root);

});

select.open();

return def.then(function (res) {

location.reload();

})

});

}

please suggest me how to solve it.

Avatar
Abbandona
Risposta migliore

Yes, you need to migrate your code to match Odoo 16 JS, Template, Components and Widgets

It won't be backward compatible

Avatar
Abbandona
Autore

Will you please suggest me how to solve this problem
regards.

Sorry to say that it's not an easy task. I have done this kind of JS migrations and it's a pain for several days. It definitely could be done but you need to understand old and new code of the process, widgets and component involved in order to make the necessary changes. Perhaps this could be an easy one... or not, but all depends on the requirements of what this JS used to solve and if that it's an issue today

Post correlati Risposte Visualizzazioni Attività
1
set 23
1751
1
dic 23
1403
1
mag 25
2441
1
apr 25
3461
1
apr 25
4281