|
@@ -80,7 +80,7 @@ angular.module('odoo')
|
|
|
|
|
|
// Sync leads data between local and remote storage
|
|
// Sync leads data between local and remote storage
|
|
var sync = function (success, error) {
|
|
var sync = function (success, error) {
|
|
- local.retrieve('remote_id = 0', function (newLeads) {
|
|
|
|
|
|
+ local.retrieve("remote_id = 0 AND type = 'lead'", function (newLeads) {
|
|
console.log(newLeads);
|
|
console.log(newLeads);
|
|
asyncLoop(newLeads.length, function (loop) {
|
|
asyncLoop(newLeads.length, function (loop) {
|
|
var data = newLeads.item(loop.iteration());
|
|
var data = newLeads.item(loop.iteration());
|
|
@@ -102,7 +102,7 @@ angular.module('odoo')
|
|
}, function () {
|
|
}, function () {
|
|
console.log('New data sended success');
|
|
console.log('New data sended success');
|
|
|
|
|
|
- local.retrieve('remote_id != 0 AND modified = 1', function (modifiedLeads) {
|
|
|
|
|
|
+ local.retrieve("remote_id != 0 AND modified = 1 AND type = 'lead'", function (modifiedLeads) {
|
|
asyncLoop(modifiedLeads.length, function (loop) {
|
|
asyncLoop(modifiedLeads.length, function (loop) {
|
|
var localData = modifiedLeads.item(loop.iteration());
|
|
var localData = modifiedLeads.item(loop.iteration());
|
|
|
|
|
|
@@ -145,7 +145,7 @@ angular.module('odoo')
|
|
}, function () {
|
|
}, function () {
|
|
console.log('Modified data sended success');
|
|
console.log('Modified data sended success');
|
|
|
|
|
|
- local.retrieve('remote_id != 0 AND modified = 2', function (deletedLeads) {
|
|
|
|
|
|
+ local.retrieve("remote_id != 0 AND modified = 2 AND type = 'lead'", function (deletedLeads) {
|
|
asyncLoop(deletedLeads.length, function (loop) {
|
|
asyncLoop(deletedLeads.length, function (loop) {
|
|
var id = deletedLeads.item(loop.iteration()).remote_id;
|
|
var id = deletedLeads.item(loop.iteration()).remote_id;
|
|
|
|
|