details:   https://code.openbravo.com/erp/devel/pi/rev/35a4bff5296e
changeset: 17963:35a4bff5296e
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Mon Sep 17 10:22:29 2012 +0200
summary:   Fixes issue 21657: It is possible to save views that have ids in its 
fields

If a window that an id in its fields, it was not possible to save new records 
because the ID was a mandatory field without value, so the save button was not 
enabled. Now the allRequiredFieldsSet function has been modified, so it does 
not take into account id fields, because its value will be set in dal before 
inserting the new row in the database.

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
 |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r ce2509bd136d -r 35a4bff5296e 
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 Sep 14 12:45:05 2012 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
     Mon Sep 17 10:22:29 2012 +0200
@@ -1886,13 +1886,19 @@
     }
   },
 
+  isID: function (item) {
+    return item.type === '_id_13';
+  },
+
   allRequiredFieldsSet: function () {
     var i, item, length = this.getItems().length,
         value, undef, nullValue = null;
     for (i = 0; i < length; i++) {
       item = this.getItems()[i];
       value = item.getValue();
-      if (this.isRequired(item) && value !== false && value !== 0 && !value) {
+      // 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) {
         return false;
       }
     }

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to