Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
420 Ansichten
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

Avatar
Verwerfen