[REF] website: remove company_data SnippetOption
This code was use in 14.0 to allow users to edit the Company Information visible on the /contactus page. It is no longer needed as the page is now fully editable and the t-field has been replaced with static text. Part-of: odoo/odoo#138947
This commit is contained in:
@@ -1705,55 +1705,6 @@ options.registry.menu_data = options.Class.extend({
|
||||
},
|
||||
});
|
||||
|
||||
options.registry.company_data = options.Class.extend({
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
this.rpc = this.bindService("rpc");
|
||||
this.orm = this.bindService("orm");
|
||||
},
|
||||
|
||||
/**
|
||||
* Fetches data to determine the URL where the user can edit its company
|
||||
* data. Saves the info in the prototype to do this only once.
|
||||
*
|
||||
* @override
|
||||
*/
|
||||
start: function () {
|
||||
var proto = options.registry.company_data.prototype;
|
||||
var prom;
|
||||
var self = this;
|
||||
if (proto.__link === undefined) {
|
||||
prom = this.rpc('/web/session/get_session_info').then(function (session) {
|
||||
return self.orm.read("res.users", [session.uid], ["company_id"]);
|
||||
}).then(function (res) {
|
||||
proto.__link = '/web#action=base.action_res_company_form&view_type=form&id=' + encodeURIComponent(res && res[0] && res[0].company_id[0] || 1);
|
||||
});
|
||||
}
|
||||
return Promise.all([this._super.apply(this, arguments), prom]);
|
||||
},
|
||||
/**
|
||||
* When the users selects company data, opens a dialog to ask him if he
|
||||
* wants to be redirected to the company form view to edit it.
|
||||
*
|
||||
* @override
|
||||
*/
|
||||
onFocus: function () {
|
||||
var self = this;
|
||||
var proto = options.registry.company_data.prototype;
|
||||
|
||||
Dialog.confirm(this, _t("Do you want to edit the company data?"), {
|
||||
confirm_callback: function () {
|
||||
self.trigger_up('request_save', {
|
||||
reload: false,
|
||||
onSuccess: function () {
|
||||
window.location.href = proto.__link;
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
options.registry.Carousel = options.registry.CarouselHandler.extend({
|
||||
/**
|
||||
* @override
|
||||
|
||||
@@ -742,10 +742,6 @@
|
||||
data-exclude=".dropdown-toggle, li.o_header_menu_button a, [data-toggle], .o_offcanvas_logo"
|
||||
data-no-check="true"/>
|
||||
|
||||
<div data-js="company_data"
|
||||
data-selector="[data-oe-expression='res_company.partner_id']"
|
||||
data-no-check="true"/>
|
||||
|
||||
<div data-js="HeaderLayout"
|
||||
data-selector="#wrapwrap > header"
|
||||
data-no-check="true"
|
||||
|
||||
Reference in New Issue
Block a user