3
0
Fork 0

Check if button is defined and use .prop()

11.0
Guewen Baconnier 2016-01-11 12:02:39 +01:00 committed by antonio
parent 836a642c42
commit f44ddacb88
1 changed files with 2 additions and 4 deletions

View File

@ -33,10 +33,8 @@ odoo.define('web_access_rule_buttons.main', function (require) {
show_hide_edit_button: function(access) {
if (this.$buttons) {
var button = this.$buttons.find('.oe_form_button_edit');
if(access) {
button.removeAttr('disabled');
} else {
button.attr('disabled', true);
if(button) {
button.prop('disabled', !access);
}
}
}