콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
2143 화면

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?

아바타
취소
베스트 답변

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 

아바타
취소