diff -r fc8eea1df2d4 -r dcdaa8c28650 src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Aug 26 12:05:12 2019 +0200
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Wed Jul 31 17:55:38 2019 +0200
@@ -1876,6 +1876,18 @@
 <!--C4E1B578B13840ADA3BC8092798E743A-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--C4E1B578B13840ADA3BC8092798E743A--></AD_MESSAGE>
 
+<!--C768AEA530B44845ACBDA07AA15CF291--><AD_MESSAGE>
+<!--C768AEA530B44845ACBDA07AA15CF291-->  <AD_MESSAGE_ID><![CDATA[C768AEA530B44845ACBDA07AA15CF291]]></AD_MESSAGE_ID>
+<!--C768AEA530B44845ACBDA07AA15CF291-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C768AEA530B44845ACBDA07AA15CF291-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C768AEA530B44845ACBDA07AA15CF291-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C768AEA530B44845ACBDA07AA15CF291-->  <VALUE><![CDATA[OBMOBC_MasterdataRequestError]]></VALUE>
+<!--C768AEA530B44845ACBDA07AA15CF291-->  <MSGTEXT><![CDATA[There was an error in the masterdata requests, aborted current refresh]]></MSGTEXT>
+<!--C768AEA530B44845ACBDA07AA15CF291-->  <MSGTYPE><![CDATA[W]]></MSGTYPE>
+<!--C768AEA530B44845ACBDA07AA15CF291-->  <AD_MODULE_ID><![CDATA[08943B85ADF64E708797A753E5B6AAEE]]></AD_MODULE_ID>
+<!--C768AEA530B44845ACBDA07AA15CF291-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--C768AEA530B44845ACBDA07AA15CF291--></AD_MESSAGE>
+
 <!--C88B6F2C58B3477BAEA816BF54559E50--><AD_MESSAGE>
 <!--C88B6F2C58B3477BAEA816BF54559E50-->  <AD_MESSAGE_ID><![CDATA[C88B6F2C58B3477BAEA816BF54559E50]]></AD_MESSAGE_ID>
 <!--C88B6F2C58B3477BAEA816BF54559E50-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r fc8eea1df2d4 -r dcdaa8c28650 src-db/database/sourcedata/AD_PREFERENCE.xml
--- a/src-db/database/sourcedata/AD_PREFERENCE.xml	Mon Aug 26 12:05:12 2019 +0200
+++ b/src-db/database/sourcedata/AD_PREFERENCE.xml	Wed Jul 31 17:55:38 2019 +0200
@@ -22,6 +22,17 @@
 <!--01EAFAD3A2204971A35D18E8CEBE9F8C-->  <AD_MODULE_ID><![CDATA[08943B85ADF64E708797A753E5B6AAEE]]></AD_MODULE_ID>
 <!--01EAFAD3A2204971A35D18E8CEBE9F8C--></AD_PREFERENCE>
 
+<!--0280B1B0ED464B34924688C1C678A52A--><AD_PREFERENCE>
+<!--0280B1B0ED464B34924688C1C678A52A-->  <AD_PREFERENCE_ID><![CDATA[0280B1B0ED464B34924688C1C678A52A]]></AD_PREFERENCE_ID>
+<!--0280B1B0ED464B34924688C1C678A52A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--0280B1B0ED464B34924688C1C678A52A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--0280B1B0ED464B34924688C1C678A52A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--0280B1B0ED464B34924688C1C678A52A-->  <VALUE><![CDATA[Y]]></VALUE>
+<!--0280B1B0ED464B34924688C1C678A52A-->  <PROPERTY><![CDATA[OBMOBC_NotAutoLoadIncrementalAtLogin]]></PROPERTY>
+<!--0280B1B0ED464B34924688C1C678A52A-->  <ISPROPERTYLIST><![CDATA[Y]]></ISPROPERTYLIST>
+<!--0280B1B0ED464B34924688C1C678A52A-->  <AD_MODULE_ID><![CDATA[08943B85ADF64E708797A753E5B6AAEE]]></AD_MODULE_ID>
+<!--0280B1B0ED464B34924688C1C678A52A--></AD_PREFERENCE>
+
 <!--18639B6C06B44324A65D199CD8A32440--><AD_PREFERENCE>
 <!--18639B6C06B44324A65D199CD8A32440-->  <AD_PREFERENCE_ID><![CDATA[18639B6C06B44324A65D199CD8A32440]]></AD_PREFERENCE_ID>
 <!--18639B6C06B44324A65D199CD8A32440-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r fc8eea1df2d4 -r dcdaa8c28650 src-db/database/sourcedata/AD_REF_LIST.xml
--- a/src-db/database/sourcedata/AD_REF_LIST.xml	Mon Aug 26 12:05:12 2019 +0200
+++ b/src-db/database/sourcedata/AD_REF_LIST.xml	Wed Jul 31 17:55:38 2019 +0200
@@ -307,6 +307,18 @@
 <!--645E9EE10111462CB8C4E6B9E504CEA3-->  <AD_MODULE_ID><![CDATA[08943B85ADF64E708797A753E5B6AAEE]]></AD_MODULE_ID>
 <!--645E9EE10111462CB8C4E6B9E504CEA3--></AD_REF_LIST>
 
+<!--6E6E9B37800B4F50AAAD606330E887C3--><AD_REF_LIST>
+<!--6E6E9B37800B4F50AAAD606330E887C3-->  <AD_REF_LIST_ID><![CDATA[6E6E9B37800B4F50AAAD606330E887C3]]></AD_REF_LIST_ID>
+<!--6E6E9B37800B4F50AAAD606330E887C3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6E6E9B37800B4F50AAAD606330E887C3-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6E6E9B37800B4F50AAAD606330E887C3-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6E6E9B37800B4F50AAAD606330E887C3-->  <VALUE><![CDATA[OBMOBC_BackgroundMasterdataMaxSize]]></VALUE>
+<!--6E6E9B37800B4F50AAAD606330E887C3-->  <NAME><![CDATA[Background Masterdata Maximum Size]]></NAME>
+<!--6E6E9B37800B4F50AAAD606330E887C3-->  <DESCRIPTION><![CDATA[Maximum size for all models for incremental masterdata refresh in background. Value -1 disable the background refresh of the masterdata]]></DESCRIPTION>
+<!--6E6E9B37800B4F50AAAD606330E887C3-->  <AD_REFERENCE_ID><![CDATA[A26BA480E2014707B47257024C3CBFF7]]></AD_REFERENCE_ID>
+<!--6E6E9B37800B4F50AAAD606330E887C3-->  <AD_MODULE_ID><![CDATA[08943B85ADF64E708797A753E5B6AAEE]]></AD_MODULE_ID>
+<!--6E6E9B37800B4F50AAAD606330E887C3--></AD_REF_LIST>
+
 <!--73967117B13C4B5EAEA505E04A7E80A3--><AD_REF_LIST>
 <!--73967117B13C4B5EAEA505E04A7E80A3-->  <AD_REF_LIST_ID><![CDATA[73967117B13C4B5EAEA505E04A7E80A3]]></AD_REF_LIST_ID>
 <!--73967117B13C4B5EAEA505E04A7E80A3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r fc8eea1df2d4 -r dcdaa8c28650 web/org.openbravo.mobile.core/source/data/ob-dal.js
--- a/web/org.openbravo.mobile.core/source/data/ob-dal.js	Mon Aug 26 12:05:12 2019 +0200
+++ b/web/org.openbravo.mobile.core/source/data/ob-dal.js	Wed Jul 31 17:55:38 2019 +0200
@@ -2164,7 +2164,14 @@
    *
    *
    */
-  OB.Dal.loadModels = function(online, models, data, incremental, callback) {
+  OB.Dal.loadModels = function(
+    online,
+    models,
+    data,
+    incremental,
+    callback,
+    background
+  ) {
     var timestamp = 0;
     var key;
 
@@ -2209,6 +2216,7 @@
         // We can safely set the POSLastIncRefresh timestamp now.
         OB.UTIL.localStorage.setItem("POSLastIncRefresh", new Date().getTime());
         dalLoadModelsCallback();
+        return;
       }
       if (
         OB.MobileApp.model.get("modelsToLoad").length === 0 &&
@@ -2436,36 +2444,40 @@
                   }
                 }
               };
-              OB.Data.localDB.transaction(
-                function(tx) {
-                  tx.executeSql(
-                    "select count(1) as totalRecords from " +
-                      item.prototype.tableName,
-                    [],
-                    function(tx, result) {
-                      logMsgForTransaction(
-                        true,
-                        item.prototype.modelName,
-                        result.rows.item(0).totalRecords
-                      );
-                      checkRecordsWithBackend(
-                        item.prototype.modelName,
-                        result.rows.item(0).totalRecords
-                      );
-                    },
-                    function() {
-                      logMsgForTransaction(false, item.prototype.modelName);
-                    }
-                  );
-                },
-                function(errorMsg) {
-                  OB.error(errorMsg);
-                  finishTransaction();
-                },
-                function() {
-                  finishTransaction();
-                }
-              );
+              if (incremental) {
+                finishTransaction();
+              } else {
+                OB.Data.localDB.transaction(
+                  function(tx) {
+                    tx.executeSql(
+                      'select count(1) as totalRecords from ' +
+                        item.prototype.tableName,
+                      [],
+                      function(tx, result) {
+                        logMsgForTransaction(
+                          true,
+                          item.prototype.modelName,
+                          result.rows.item(0).totalRecords
+                        );
+                        checkRecordsWithBackend(
+                          item.prototype.modelName,
+                          result.rows.item(0).totalRecords
+                        );
+                      },
+                      function() {
+                        logMsgForTransaction(false, item.prototype.modelName);
+                      }
+                    );
+                  },
+                  function(errorMsg) {
+                    OB.error(errorMsg);
+                    finishTransaction();
+                  },
+                  function() {
+                    finishTransaction();
+                  }
+                );
+              }
             }
 
             // Skip load of models if it's a incremental refresh and the request timeout has been reached
@@ -2481,7 +2493,7 @@
             item.params.terminalTime = currentDate;
             item.params.terminalTimeOffset = currentDate.getTimezoneOffset();
           }
-          ds.load(item.params, incremental);
+          ds.load(item.params, incremental, background);
         }
       } else if (
         item &&
diff -r fc8eea1df2d4 -r dcdaa8c28650 web/org.openbravo.mobile.core/source/data/ob-datasource.js
--- a/web/org.openbravo.mobile.core/source/data/ob-datasource.js	Mon Aug 26 12:05:12 2019 +0200
+++ b/web/org.openbravo.mobile.core/source/data/ob-datasource.js	Wed Jul 31 17:55:38 2019 +0200
@@ -20,6 +20,8 @@
     OB.DS.requestAllowed = isAllowed;
   };
 
+  OB.DS.masterdataBackgroundModels = {}; // To store the models loaded in the masterdata refresh done in background
+
   function serviceSuccess(inSender, inResponse, callback, tx) {
     if (inResponse._entityname) {
       callback([inResponse]);
@@ -616,15 +618,8 @@
   };
   _.extend(OB.DS.DataSource.prototype, Backbone.Events);
 
-  OB.DS.DataSource.prototype.load = function(params, incremental) {
+  OB.DS.DataSource.prototype.load = function(params, incremental, background) {
     this.modelPagination = 1;
-    OB.info(
-      "[sdreresh-" +
-        (incremental ? "inc" : "full") +
-        "] The model " +
-        this.request.model.prototype.modelName +
-        " has started masterdata load"
-    );
     var me = this,
       handleError,
       handleIncrementalRequest,
@@ -644,29 +639,67 @@
 
       me.trigger("ready", "failed");
     };
-    handleIncrementalRequest = function(
-      limit,
-      offset,
-      params,
-      incremental,
-      lastId
+
+    const updateModelLastUpdatedTimestamp = function(
+      lastUpdated,
+      data,
+      totalRows
     ) {
-      params = params || {};
-      params._limit = limit;
-      params._offset = offset;
-      params._count = OB.UTIL.localStorage.getItem(
-        "recordsFromBackendFor" + me.request.model.prototype.modelName
-      )
-        ? parseInt(
+      if (lastUpdated && data.length > 0) {
+        if (
+          OB.UTIL.localStorage.getItem(
+            'requestTimestamp' + me.request.model.prototype.modelName
+          ) &&
+          OB.UTIL.localStorage.getItem(
+            'requestTimestamp' + me.request.model.prototype.modelName
+          ) !== 'null'
+        ) {
+          OB.UTIL.localStorage.setItem(
+            'lastUpdatedTimestamp' + me.request.model.prototype.modelName,
             OB.UTIL.localStorage.getItem(
-              "recordsFromBackendFor" + me.request.model.prototype.modelName
-            ),
-            10
-          )
-        : 0;
-      params._isMasterdata = true;
-      params.overrideDefaultTimeout = true;
-      params.lastId = lastId;
+              'requestTimestamp' + me.request.model.prototype.modelName
+            )
+          );
+        } else {
+          OB.error(
+            '[lastUpdatedTimestamp] ' +
+              'local storage (lastUpdatedTimestamp' +
+              me.request.model.prototype.modelName +
+              ') attempted to be set as null. Ignored. Current Value: ' +
+              OB.UTIL.localStorage.getItem(
+                'lastUpdatedTimestamp' + me.request.model.prototype.modelName
+              )
+          );
+        }
+        OB.UTIL.localStorage.removeItem(
+          'requestTimestamp' + me.request.model.prototype.modelName
+        );
+        OB.UTIL.localStorage.setItem(
+          'recordsFromBackendFor' + me.request.model.prototype.modelName,
+          totalRows
+        );
+      } else {
+        if (
+          OB.UTIL.localStorage.getItem(
+            'requestTimestamp' + me.request.model.prototype.modelName
+          ) &&
+          OB.UTIL.localStorage.getItem(
+            'requestTimestamp' + me.request.model.prototype.modelName
+          ) !== 'null'
+        ) {
+          OB.UTIL.localStorage.setItem(
+            'lastUpdatedTimestamp' + me.request.model.prototype.modelName,
+            OB.UTIL.localStorage.getItem(
+              'requestTimestamp' + me.request.model.prototype.modelName
+            )
+          );
+        }
+      }
+    };
+
+    const doModelRequest = function(params, functionSave, errorCallback) {
+      var offset = params._offset;
+      var limit = params._limit;
       if (offset === 0) {
         OB.UTIL.localStorage.setItem(
           "requestTimestamp" + me.request.model.prototype.modelName,
@@ -685,6 +718,10 @@
           ])
         );
       }
+      delete params._data;
+      delete params._model;
+      delete params._lastUpdated;
+      delete params._totalRows;
       me.request.exec(
         params,
         function(data, message, lastUpdated, totalRows) {
@@ -726,7 +763,8 @@
                 offset + limit,
                 params,
                 incremental,
-                newLastId
+                newLastId,
+                background
               );
             } else {
               OB.UTIL.completeLoadingStep();
@@ -744,106 +782,44 @@
                   " records in the pagination " +
                   me.modelPagination
               );
-              OB.info(
-                "[sdreresh-" +
-                  (incremental ? "inc" : "full") +
-                  "] The model " +
-                  me.request.model.prototype.modelName +
-                  " has finished loading with a total of " +
-                  dataLoaded +
-                  " records. " +
-                  (me.modelPagination === 1
-                    ? "There was no pagination."
-                    : "The number of paginations created were " +
-                      me.modelPagination)
-              );
-              if (lastUpdated && data.length > 0) {
-                if (
-                  OB.UTIL.localStorage.getItem(
-                    "requestTimestamp" + me.request.model.prototype.modelName
-                  ) &&
-                  OB.UTIL.localStorage.getItem(
-                    "requestTimestamp" + me.request.model.prototype.modelName
-                  ) !== "null"
-                ) {
-                  OB.UTIL.localStorage.setItem(
-                    "lastUpdatedTimestamp" +
-                      me.request.model.prototype.modelName,
-                    OB.UTIL.localStorage.getItem(
-                      "requestTimestamp" + me.request.model.prototype.modelName
-                    )
-                  );
-                } else {
-                  OB.error(
-                    "[lastUpdatedTimestamp] " +
-                      "local storage (lastUpdatedTimestamp" +
-                      me.request.model.prototype.modelName +
-                      ") attempted to be set as null. Ignored. Current Value: " +
-                      OB.UTIL.localStorage.getItem(
-                        "lastUpdatedTimestamp" +
-                          me.request.model.prototype.modelName
-                      )
-                  );
-                }
-                OB.UTIL.localStorage.removeItem(
-                  "requestTimestamp" + me.request.model.prototype.modelName
+              if (dataLoaded > 0) {
+                OB.info(
+                  '[sdreresh-' +
+                    (incremental ? 'inc' : 'full') +
+                    '] The model ' +
+                    me.request.model.prototype.modelName +
+                    ' has finished loading with a total of ' +
+                    dataLoaded +
+                    ' records. ' +
+                    (me.modelPagination === 1
+                      ? 'There was no pagination.'
+                      : 'The number of paginations created were ' +
+                        me.modelPagination)
                 );
-                OB.UTIL.localStorage.setItem(
-                  "recordsFromBackendFor" +
-                    me.request.model.prototype.modelName,
-                  totalRows
-                );
-              } else {
-                if (
-                  OB.UTIL.localStorage.getItem(
-                    "requestTimestamp" + me.request.model.prototype.modelName
-                  ) &&
-                  OB.UTIL.localStorage.getItem(
-                    "requestTimestamp" + me.request.model.prototype.modelName
-                  ) !== "null"
-                ) {
-                  OB.UTIL.localStorage.setItem(
-                    "lastUpdatedTimestamp" +
-                      me.request.model.prototype.modelName,
-                    OB.UTIL.localStorage.getItem(
-                      "requestTimestamp" + me.request.model.prototype.modelName
-                    )
-                  );
-                }
               }
+
+              if (background === undefined) {
+                updateModelLastUpdatedTimestamp(lastUpdated, data, totalRows);
+              }
+
               me.trigger("ready");
             }
           }
           if (data.exception) {
             OB.error("Error in datasource: " + data.exception);
+            OB.DS.masterdataBackgroundModels = {};
             me.trigger("ready", "failed");
             return;
           }
           if (me.request.model && me.request.model.prototype.online) {
             me.cache = me.cache ? me.cache.concat(data) : data;
           }
-          if (me.request.model && !me.request.model.prototype.online) {
-            if (offset === 0) {
-              OB.Dal.initCache(
-                me.request.model,
-                data,
-                success,
-                handleError,
-                incremental
-              );
-            } else {
-              OB.Dal.insertData(
-                me.request.model,
-                data,
-                success,
-                handleError,
-                incremental,
-                dataLoaded
-              );
-            }
-          } else {
-            success();
-          }
+
+          params._data = data;
+          params._model = me.request.model;
+          params._lastUpdated = lastUpdated;
+          params._totalRows = totalRows;
+          functionSave(params, success, errorCallback);
         },
         function(data) {
           OB.UTIL.Debug.execute(function() {
@@ -854,6 +830,14 @@
               return;
             }
           });
+          OB.DS.masterdataBackgroundModels = {};
+
+          OB.info(
+            OB.I18N.getLabel('OBMOBC_MasterdataRequestError') +
+              '. URL which failed: ' +
+              me.request.source
+          );
+          OB.UTIL.showI18NWarning('OBMOBC_MasterdataRequestError');
           if (
             data &&
             data.exception &&
@@ -876,6 +860,172 @@
       );
     };
 
+    const doModelDataSave = function(params, success, handleError) {
+      const offset = params._offset;
+      const data = params._data;
+      const model = params._model;
+      if (model && !model.prototype.online) {
+        if (offset === 0) {
+          OB.Dal.initCache(model, data, success, handleError, incremental);
+        } else {
+          OB.Dal.insertData(
+            model,
+            data,
+            success,
+            handleError,
+            incremental,
+            dataLoaded
+          );
+        }
+      } else {
+        success();
+      }
+    };
+
+    const doModelDataSaveInRAM = function(params, success, handleError) {
+      const data = params._data;
+      const limit = params._limit;
+      const currentLength = data.length;
+      const backgroundLimit = OB.MobileApp.model.hasPermission(
+        'OBMOBC_BackgroundMasterdataMaxSize',
+        true
+      )
+        ? OB.MobileApp.model.hasPermission(
+            'OBMOBC_BackgroundMasterdataMaxSize',
+            true
+          )
+        : limit;
+      if (
+        OB.DS.masterdataBackgroundModels['totalLength'] + currentLength >
+        backgroundLimit
+      ) {
+        OB.info(
+          'Failed to do masterdata refresh in background because exceeds the limit of data. Trying normal refresh.'
+        );
+        OB.UTIL.localStorage.setItem('neededForeGroundMasterDataRefresh');
+        OB.UTIL.refreshMasterDataForeground();
+        OB.DS.masterdataBackgroundModels = {};
+        return;
+      }
+      if (!OB.DS.masterdataBackgroundModels.hasOwnProperty(me.request.source)) {
+        OB.DS.masterdataBackgroundModels[me.request.source] = {};
+        OB.DS.masterdataBackgroundModels[me.request.source]['data'] = [];
+      }
+
+      OB.DS.masterdataBackgroundModels[me.request.source]['data'] = [
+        ...OB.DS.masterdataBackgroundModels[me.request.source]['data'],
+        ...params._data
+      ];
+
+      OB.DS.masterdataBackgroundModels[me.request.source]['model'] =
+        params._model;
+      OB.DS.masterdataBackgroundModels[me.request.source]['lastUpdated'] =
+        params._lastUpdated;
+      OB.DS.masterdataBackgroundModels[me.request.source]['totalRows'] =
+        params._totalRows;
+
+      OB.DS.masterdataBackgroundModels[me.request.source]['lastUpdated'] =
+        me.request.lastUpdated;
+
+      if (!OB.DS.masterdataBackgroundModels.hasOwnProperty('totalLength')) {
+        OB.DS.masterdataBackgroundModels['totalLength'] = 0;
+      }
+      OB.DS.masterdataBackgroundModels['totalLength'] += currentLength;
+      success();
+    };
+
+    const doModelReadFromRAM = function(params, functionSave, errorCallback) {
+      if (
+        OB.DS.masterdataBackgroundModels[me.request.source]['data'].length === 0
+      ) {
+        me.trigger('ready');
+        return;
+      }
+      let parameters = {};
+      parameters._data =
+        OB.DS.masterdataBackgroundModels[me.request.source]['data'];
+      parameters._model =
+        OB.DS.masterdataBackgroundModels[me.request.source]['model'];
+      const lastUpdated_ =
+        OB.DS.masterdataBackgroundModels[me.request.source]['lastUpdated'];
+      const totalRows =
+        OB.DS.masterdataBackgroundModels[me.request.source]['totalRows'];
+      parameters._offset = 0; // in background all the pages are concatenated into one
+
+      const success = function() {
+        OB.info(
+          '[sdreresh-' +
+            (incremental ? 'inc' : 'full') +
+            '] The model ' +
+            me.request.model.prototype.modelName +
+            ' has finished saving in db with a total of ' +
+            parameters._data.length +
+            ' records. '
+        );
+        updateModelLastUpdatedTimestamp(
+          lastUpdated_,
+          parameters._data,
+          totalRows
+        );
+        me.trigger('ready');
+      };
+      functionSave(parameters, success, errorCallback);
+    };
+
+    handleIncrementalRequest = function(
+      limit,
+      offset,
+      params,
+      incremental,
+      lastId,
+      background
+    ) {
+      params = params || {};
+      params._limit = limit;
+      params._offset = offset;
+      params._count = OB.UTIL.localStorage.getItem(
+        'recordsFromBackendFor' + me.request.model.prototype.modelName
+      )
+        ? parseInt(
+            OB.UTIL.localStorage.getItem(
+              'recordsFromBackendFor' + me.request.model.prototype.modelName
+            ),
+            10
+          )
+        : 0;
+      params._isMasterdata = true;
+      params.overrideDefaultTimeout = true;
+      params.lastId = lastId;
+      params.incremental = incremental;
+
+      if (background === undefined) {
+        // foreground
+        doModelRequest(
+          params,
+          function(params, successCallback, errorCallback) {
+            doModelDataSave(params, successCallback, errorCallback);
+          },
+          handleError
+        );
+      } else if (background === 'background-request') {
+        doModelRequest(
+          params,
+          function(params, successCallback, errorCallback) {
+            doModelDataSaveInRAM(params, successCallback, errorCallback);
+          },
+          handleError
+        );
+      } else if (background === 'background-save') {
+        doModelReadFromRAM(
+          params,
+          function(params, successCallback, errorCallback) {
+            doModelDataSave(params, successCallback, errorCallback);
+          },
+          handleError
+        );
+      }
+    };
+
     this.cache = null;
     var lastId = null; // First request don't have lastId
     handleIncrementalRequest(
@@ -887,7 +1037,8 @@
       0,
       params,
       incremental,
-      lastId
+      lastId,
+      background
     );
   };
 
diff -r fc8eea1df2d4 -r dcdaa8c28650 web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
--- a/web/org.openbravo.mobile.core/source/model/ob-terminal-model.js	Mon Aug 26 12:05:12 2019 +0200
+++ b/web/org.openbravo.mobile.core/source/model/ob-terminal-model.js	Wed Jul 31 17:55:38 2019 +0200
@@ -1985,7 +1985,7 @@
     OB.UTIL.showLoading(false);
   },
 
-  loadModels: function(windows, incremental, callback) {
+  loadModels: function(windows, incremental, parentCallback, background) {
     var i,
       j,
       windowName,
@@ -1997,6 +1997,16 @@
       c,
       path;
 
+    const callback = function() {
+      OB.info(
+        '[sdrefresh] Finished loading models ' +
+          (incremental ? 'incrementally' : 'full') +
+          '.' +
+          (background ? ' (' + background + ' )' : '')
+      );
+      parentCallback();
+    };
+
     if (OB.MobileApp.model.get("loggedOffline")) {
       if (callback instanceof Function) {
         callback();
@@ -2014,7 +2024,8 @@
     OB.info(
       "[sdrefresh] Load models " +
         (incremental ? "incrementally" : "full") +
-        "."
+        '.' +
+        (background ? ' (' + background + ' )' : '')
     );
 
     for (i = 0; i < windows.length; i++) {
@@ -2056,9 +2067,20 @@
 
     _.extend(datasources, Backbone.Events);
 
-    OB.debug("[sdrefresh] window: " + windowName);
+    OB.debug(
+      '[sdrefresh] window: ' +
+        windowName +
+        (background ? '. (' + background + ' )' : '')
+    );
 
-    OB.Dal.loadModels(false, datasources, null, incremental, callback);
+    OB.Dal.loadModels(
+      false,
+      datasources,
+      null,
+      incremental,
+      callback,
+      background
+    );
 
     this.postLoadModels();
   },
