Skip to Content
Menú
This question has been flagged
1 Respondre
3540 Vistes

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

Avatar
Descartar
Best Answer

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
Descartar
Related Posts Respostes Vistes Activitat
1
de juny 24
2661
1
d’abr. 24
9531
1
de maig 22
3780
2
de juny 21
3052
1
de set. 20
2848