Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
3518 Tampilan

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

Avatar
Buang
Jawaban Terbai

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

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Jun 24
2610
1
Apr 24
9484
1
Mei 22
3764
2
Jun 21
3023
1
Sep 20
2825