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)
--- 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;
}
}