Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
422 Lượt xem
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

Ảnh đại diện
Huỷ bỏ