コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
2117 ビュー

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 

アバター
破棄