Fixes issue 22690: Save button is enabled in Return to Vendor window
authorAugusto Mauch <augusto.mauch@openbravo.com>
Mon, 31 Dec 2012 11:05:17 +0100
changeset 19199 8f2c7c6d1899
parent 19198 552342cfa929
child 19200 18970d099fa0
Fixes issue 22690: Save button is enabled in Return to Vendor window

The save button was not being enabled because there was one mandatory field (grandTotalAmount) that was empty. The thing is that this field belongs to the status bar, so it is read only, and should not be taken into account when cheking if all the mandatory fields have been set.

The allRequiredFieldsSet function has been modified so that it doesn't take into account the fields that are not displayed in the form (i.e. the status bar fields)
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Fri Dec 28 10:33:01 2012 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Mon Dec 31 11:05:17 2012 +0100
@@ -1915,7 +1915,7 @@
       value = item.getValue();
       // Do no check ids, even though they are mandatory they are automatically set DAL before
       // storing the record in the database. See issue https://issues.openbravo.com/view.php?id=21657
-      if (this.isRequired(item) && !this.isID(item) && value !== false && value !== 0 && !value) {
+      if (this.isRequired(item) && (item.displayed !== false) && !this.isID(item) && value !== false && value !== 0 && !value) {
         return false;
       }
     }