Skip to Content
Menu
This question has been flagged
1 Odpoveď
3546 Zobrazenia

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

Avatar
Zrušiť
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
Zrušiť
Related Posts Replies Zobrazenia Aktivita
1
jún 24
2662
1
apr 24
9535
1
máj 22
3781
2
jún 21
3054
1
sep 20
2850