Browse Source

[IMP] use _update_tab_invalid_class funcion name instead of _check_invalid_tab, update tab.attr('id') condition, update description

pull/370/head
Cesar Lage 8 years ago
parent
commit
12b1c55d15
  1. 2
      web_invalid_tab/README.rst
  2. 6
      web_invalid_tab/static/src/js/view_form.js

2
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
===========

6
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');

Loading…
Cancel
Save