Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
3505 Prikazi

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

Avatar
Opusti
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
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
jun. 24
2609
1
apr. 24
9476
1
maj 22
3759
2
jun. 21
3020
1
sep. 20
2819