跳至內容
選單
此問題已被標幟
1 回覆
3515 瀏覽次數

No one should be able to edit the form once the process is completed.

頭像
捨棄
最佳答案

Hi,

Try the below Javascript code 

odoo.define('module.extension_name', function (require) {
var FormView = require('web.FormView');
FormView.include({
load_record: function() {
this._super.apply(this, arguments);
if (this.model === 'your.model') {
if (this.datarecord && (this.datarecord.state === 'state')) {
this.$buttons.find('.o_form_button_edit').css({'display':'none'});
}
else {
this.$buttons.find('.o_form_button_edit').css({'display':''});
}
}
});
});

And include the file in assets:

Regards

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
6月 24
2610
1
4月 24
9483
1
5月 22
3762
2
6月 21
3023
1
9月 20
2825