From 12b1c55d1558a26309a566940dd25211ba645921 Mon Sep 17 00:00:00 2001 From: Cesar Lage Date: Fri, 12 Aug 2016 10:27:51 -0400 Subject: [PATCH] [IMP] use _update_tab_invalid_class funcion name instead of _check_invalid_tab, update tab.attr('id') condition, update description --- web_invalid_tab/README.rst | 2 +- web_invalid_tab/static/src/js/view_form.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web_invalid_tab/README.rst b/web_invalid_tab/README.rst index 1ceea8b8..a62ff311 100644 --- a/web_invalid_tab/README.rst +++ b/web_invalid_tab/README.rst @@ -6,7 +6,7 @@ Web invalid tab =============== -This module highlights a tab when fields inside are invalid. Is useful when you have a form with many tabs. +This module highlights a tab when fields inside are invalid. It's useful when you have a form with many tabs. Bug Tracker =========== diff --git a/web_invalid_tab/static/src/js/view_form.js b/web_invalid_tab/static/src/js/view_form.js index 706e7c91..41d9f322 100644 --- a/web_invalid_tab/static/src/js/view_form.js +++ b/web_invalid_tab/static/src/js/view_form.js @@ -26,13 +26,13 @@ openerp.web_invalid_tab = function(instance) { if (!this.disable_utility_classes) { if (this.field_manager.get('display_invalid_fields')) { this.$el.toggleClass('oe_form_invalid', !this.is_valid()); - this._check_invalid_tab(); + this._update_tab_invalid_class(); } } }, - _check_invalid_tab: function() { + _update_tab_invalid_class: function() { var tab = this.$el.closest(tab_selector); - if (tab && tab.attr('id')) { + if (tab.attr('id')) { if (this.is_valid()) { if (tab.find('.oe_form_invalid').length == 0) { tab_link(tab).removeClass('oe_form_tab_invalid');