Check if buttons are set in case we are in a popup window

This commit is contained in:
Yannick Vaucher
2016-01-05 15:44:47 +01:00
committed by antonio
parent 400030f06a
commit bad95ccf02

View File

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