Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
421 Переглядів
odoo.define("hide_archive_unarchive_buttons.BasicView", function (require) {
"use strict";
var BasicView = require("web.BasicView");
var rpc = require("web.rpc");


BasicView.include({
init: function (viewInfo, params) {
this._super(viewInfo, params);
var self = this;
rpc.query({
model: "ir.config_parameter",
method: "get_to_archive_models",
args: [[]],
}).then(function (models) {
if (models.includes(self.controllerParams.modelName)) {
console.log("code executed");
self.controllerParams.archiveEnabled = "False" in viewInfo.fields;
}
});
},
});
});

This code works perfectly on the odoo15 but its not working on odoo16, I doubt that the code inside the include block is not getting executed,i have also tried with the patch and extend methods. There is no error but the "code executed" statement is not getting printed in console

Аватар
Відмінити