Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
3514 Visninger

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

Avatar
Kassér
Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
1
jun. 24
2610
1
apr. 24
9482
1
maj 22
3762
2
jun. 21
3022
1
sep. 20
2824