[FIX] website: restore company edition option

Commit d1a8d54aca broke the feature without mercy.

The mentioned commit introduces a nice improvement to allow the edition
of the company logo directly from frontend. However it also breaks the
option for non-logo parts (example: clicking on the address on the
contact us page). It also leaves most of the option code behind, which
makes useless code being executed for nothing.

This commit restores the company option the way it was and simply
deactivates it for the logo edition, which was the desired behavior.
This commit is contained in:
qsm-odoo
2017-02-14 12:33:53 +01:00
parent cf1df16aea
commit 9049d953ca
2 changed files with 17 additions and 1 deletions
@@ -70,6 +70,22 @@ options.registry.company_data = options.Class.extend({
});
}
},
on_focus: function () {
this._super.apply(this, arguments);
var proto = options.registry.company_data.prototype;
Dialog.confirm(null, _t("Do you want to edit the company data ?"), {
confirm_callback: function () {
editor.editor_bar.save_without_reload().then(function () {
proto.__link_deferred.then(function (link) {
window.location.href = link;
});
});
},
});
},
});
options.registry.slider = options.Class.extend({
+1 -1
View File
@@ -874,7 +874,7 @@
data-no-check="true"/>
<div data-js="company_data"
data-selector="img[src='/logo.png'], [data-oe-expression='res_company.partner_id']"
data-selector="[data-oe-expression='res_company.partner_id']"
data-no-check="true"/>
</template>
</odoo>