# HG changeset patch
# User Miguel de Juana <miguel.dejuana@openbravo.com>
# Date 1458062648 -3600
#      Tue Mar 15 18:24:08 2016 +0100
# Node ID 535463618401544f5d841a9487423732aafb1fae
# Parent  2bc0dbcc2429c27370f69b0c888ec1a3b19c2095
Fixed issue 0031004: A red icon indicating data not synchronised is shown even if nothing needs to be synchronised

- dataSyncModels is inside the terminal, it is code, it is not terminal model info. It has functions and when we convert to JSON the terminal info to save it in the local database, we lost these functions(cannot have functions in a JSON). We can decide to do not override this attribute and we do not lost those methods

diff --git a/web/org.openbravo.mobile.core/source/model/ob-terminal-model.js b/web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
--- a/web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
+++ b/web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
@@ -266,13 +266,13 @@
 
   processPropertyLoaders: function () {
     OB.debug("next process: allPropertiesLoaded");
-    var termInfo, msg, key;
+    var termInfo, msg, key, keysToSkip = ['dataSyncModels'];
     if (this.get('loggedOffline')) {
       //Load from termInfo
       if (this.usermodel.get('terminalinfo')) {
         termInfo = JSON.parse(this.usermodel.get('terminalinfo'));
         for (key in termInfo) {
-          if (termInfo.hasOwnProperty(key)) {
+          if (termInfo.hasOwnProperty(key) && keysToSkip.indexOf(key) === -1) { //If it is not in the keys to skip
             this.set(key, termInfo[key]);
           }
         }
