diff --git a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
@@ -1067,7 +1067,7 @@
       if (this.filterEditor && !this.filterEditor.getEditForm()) {
         this.filterEditor.setValuesAsCriteria(localState.filter);
       }
-      
+
       this.setCriteria(localState.filter);
     }
   },
@@ -1445,7 +1445,7 @@
     this.view.updateTabTitle();
 
     delete this.initialCriteria;
-    
+
     // do not refresh if the parent is not selected and we have no data
     // anyway
     if (this.view.parentProperty && (!this.data || !this.data.getLength || this.data.getLength() === 0)) {
@@ -2569,6 +2569,7 @@
     // set the default error message,
     // is possibly overridden in the next call
     if (record) {
+      record['_hasValidationErrors'] = true;
       if (!record[isc.OBViewGrid.ERROR_MESSAGE_PROP]) {
         this.setRecordErrorMessage(rowNum, OB.I18N.getLabel('OBUIAPP_ErrorInFields'));
         // do not automatically remove this message
@@ -2594,6 +2595,19 @@
     }
   },
 
+  recordHasChanges: function (rowNum) {
+    var record = this.getRecord(rowNum);
+    // If a record has validation errors but had all the mandatory fields set,
+    // smartclient's recordHasChanges will return false, and the record will be cleared (see ListGrid.hideInlineEditor function)
+    // In this case recordhasChanges should return true, because the values in the grid differ with the values in the database
+    // See issue https://issues.openbravo.com/view.php?id=22123
+    if (record && record['_hasValidationErrors']) {
+      return true;
+    } else {
+      return this.Super('recordHasChanges', arguments);
+    }
+  },
+
   editComplete: function (rowNum, colNum, newValues, oldValues, editCompletionEvent, dsResponse) {
 
     var record = this.getRecord(rowNum),
