Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
2135 Vizualizări

how can i hide the edit button on res.partner without changing the group-rights?

i tried this ( https://www.odoo.com/de_DE/forum/hilfe-1/question/is-it-possible-hide-edit-button-on-form-view-by-extending-base-xml-117347 ) but it doesn`t seems to work in Odoo V12.



odoo.define('custom_web_changes.custom_form_view', function (require) {
"use strict";
var core = require('web.core');
var FormView = require('web.FormView');
var _t = core._t;
var QWeb = core.qweb;
console.log("asd");
FormView.include({
load_record: function(record) {
this._super.apply(this, arguments);
console.log("222");
if (this.model=='res.partner'){
console.log("333");
this.$buttons.find('.o_form_button_edit').css({"display":"none"});
}
}
});
});


in the browser console i just see my "asd" Debug note but not following console.log statements.

whats wrong with my code?

Imagine profil
Abandonează
Cel mai bun răspuns

Hello,

You can inherit res.partner view using xpath and add attribute edit="false".

For example:

<form string="Signup Terms &amp; Condition" edit="false" create="false">

Regards,

Mustufa Rangwala 

Imagine profil
Abandonează