[FIX] use key/value pair for support branding

This commit is contained in:
KKamaa
2023-02-09 01:26:44 +03:00
parent 7553f530aa
commit ac624eb7fc
5 changed files with 65 additions and 107 deletions

View File

@@ -8,26 +8,23 @@ odoo.define("support_branding.ResConfigEdition", function (require) {
var self = this;
var def_1 = this._rpc({
model: "res.company",
method: "get_ir_config_param_data",
args: ["support_company"],
}).then(function (name) {
self.support_cp_name = name;
method: "get_support_branding_config_param_data",
args: [],
}).then(function (result) {
if (result && 'support_company' in result)
self.support_cp_name = result['support_company'];
if (result && 'support_company_url' in result)
self.support_cp_url = result['support_company_url'];
if (result && 'support_email' in result)
self.support_cp_email = result['support_email'];
if (result && 'support_release' in result)
self.support_cp_release = result['support_release'];
if (result && 'support_branding_color' in result)
self.support_branding_color = result[
'support_branding_color'];
});
var def_2 = this._rpc({
model: "res.company",
method: "get_ir_config_param_data",
args: ["support_company_url"],
}).then(function (url) {
self.support_cp_url = url;
});
var def_3 = this._rpc({
model: "res.company",
method: "get_ir_config_param_data",
args: ["support_email"],
}).then(function (email) {
self.support_cp_email = email;
});
return $.when(this._super.apply(this, arguments), def_1, def_2, def_3);
return $.when(this._super.apply(this, arguments), def_1);
},
});
});

View File

@@ -20,42 +20,20 @@ odoo.define("support_branding.CrashManager", function (require) {
$.when(this._super.apply(this, arguments)).then(function () {
self._rpc({
model: "res.company",
method: "get_ir_config_param_data",
args: ["support_company"],
}).then(function (name) {
self.support_cp_name = name;
});
self._rpc({
model: "res.company",
method: "get_ir_config_param_data",
args: ["support_company_url"],
}).then(function (url) {
self.support_cp_url = url;
});
self._rpc({
model: "res.company",
method: "get_ir_config_param_data",
args: ["support_email"],
}).then(function (email) {
self.support_cp_email = email;
});
self._rpc({
model: "res.company",
method: "get_ir_config_param_data",
args: ["support_release"],
}).then(function (release) {
self.support_cp_release = release;
});
self._rpc({
model: "res.company",
method: "get_ir_config_param_data",
args: ["support_branding_color"],
}).then(function (color) {
self.support_cp_color = color;
method: "get_support_branding_config_param_data",
args: [],
}).then(function (result) {
if (result && 'support_company' in result)
self.support_cp_name = result['support_company'];
if (result && 'support_company_url' in result)
self.support_cp_url = result['support_company_url'];
if (result && 'support_email' in result)
self.support_cp_email = result['support_email'];
if (result && 'support_release' in result)
self.support_cp_release = result['support_release'];
if (result && 'support_branding_color' in result)
self.support_branding_color = result[
'support_branding_color'];
});
});
},

View File

@@ -13,12 +13,13 @@ odoo.define("support_branding.UserMenu", function (require) {
var def = self
._rpc({
model: "res.company",
method: "get_ir_config_param_data",
args: ["support_company_url"],
method: "get_support_branding_config_param_data",
args: [],
})
.then(function (site) {
if (site && site !== "") {
self.support_url = site;
.then(function (result) {
if (result && 'support_company_url' in result &&
result['support_company_url'] !== "") {
self.support_url = result['support_company_url'];
}
});
return $.when(this._super.apply(this, arguments), def);