Skip to Content
Menu
This question has been flagged
1 Reply
2662 Views

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

Avatar
Discard
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
Discard
Related Posts Replies Views Activity
1
Jun 24
1073
1
Apr 24
7995
1
May 22
2366
2
Jun 21
1828
1
Sep 20
1682