Browse Source

sql modularized and sync update bug fixed

robert2206 8 years ago
parent
commit
6c6ecf1811

+ 2 - 1
bower.json

@@ -9,6 +9,7 @@
     "ngCordova": "^0.1.27-alpha",
     "ionic-filter-bar": "^1.1.1",
     "ionic-toast": "^0.4.1",
-    "angular-translate": "^2.11.1"
+    "angular-translate": "^2.11.1",
+    "squel": "^5.3.3"
   }
 }

+ 4 - 2
package.json

@@ -22,9 +22,11 @@
     "cordova-plugin-statusbar",
     "ionic-plugin-keyboard",
     "cordova-plugin-camera",
-    "cordova-plugin-contacts"
+    "cordova-plugin-contacts",
+    "cordova-plugin-vibration",
+    "cordova-plugin-file"
   ],
   "cordovaPlatforms": [
     "android"
   ]
-}
+}

+ 2 - 2
www/css/app.css

@@ -40,8 +40,8 @@
 
 .bar-icon {
     font-size:22px !important;
-    margin-right: 10px;
-    margin-left: 10px;
+    margin-right: 5px;
+    margin-left: 5px;
 }
 
 .holded {

+ 1 - 0
www/index.html

@@ -52,6 +52,7 @@
     <!-- JS -->
     <script src="lib/angular-xmlrpc/xmlrpc.js"></script>
     <script src="lib/ionic-toast/dist/ionic-toast.bundle.min.js"></script>
+    <script src="lib/squel/dist/squel-basic.js"></script>
   </head>
   <body ng-app="odoo">
       <ion-nav-view animation="slide-left-right"></ion-nav-view>

+ 137 - 196
www/js/app.js

@@ -10,211 +10,152 @@ angular.module(
     ]
 )
 
-.run(function(
-    $ionicPlatform,
-    $state,
-    configFactory
-) {
-    
-     $ionicPlatform.ready(function() {
-        if (window.cordova && window.cordova.plugins.Keyboard) {
-            cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
-            cordova.plugins.Keyboard.disableScroll(true);
-        }
-
-        if (window.StatusBar) {
-            StatusBar.overlaysWebView(false);
-            StatusBar.backgroundColorByHexString('#387ef5');
-        }
-
-        db = window.sqlitePlugin.openDatabase({ name: 'odoo.db', location: 'default' });
-         
-        db.executeSql("CREATE TABLE IF NOT EXISTS 'user' (\n\
-                       'id' INTEGER NOT NULL  PRIMARY KEY AUTOINCREMENT,\n\
-                       'remote_id' INTEGER DEFAULT 0,\n\
-                       'host' VARCHAR(35) DEFAULT 0,\n\
-                       'port' INTEGER DEFAULT 0,\n\
-                       'database' VARCHAR(35) DEFAULT NULL,\n\
-                       'username' VARCHAR(35) DEFAULT NULL,\n\
-                       'password' VARCHAR(35) DEFAULT NULL)");
-         
-        db.executeSql("CREATE TABLE IF NOT EXISTS 'partner' (\n\
-                       'id' INTEGER DEFAULT NULL PRIMARY KEY AUTOINCREMENT,\n\
-                       'remote_id' INTEGER DEFAULT 0,\n\
-                       'modified' INTEGER DEFAULT 0,\n\
-                       'modifiedDate' TEXT DEFAULT CURRENT_TIMESTAMP,\n\
-                       'name' VARCHAR(35) DEFAULT NULL,\n\
-                       'city' VARCHAR(35) DEFAULT NULL,\n\
-                       'mobile' VARCHAR(20) DEFAULT NULL,\n\
-                       'phone' VARCHAR(20) DEFAULT NULL,\n\
-                       'fax' VARCHAR(20) DEFAULT NULL,\n\
-                       'email' VARCHAR(100) DEFAULT NULL,\n\
-                       'street' VARCHAR(35) DEFAULT NULL,\n\
-                       'street2' VARCHAR(35) DEFAULT NULL,\n\
-                       'image_medium' BLOB DEFAULT NULL,\n\
-                       'image_small' BLOB DEFAULT NULL,\n\
-                       'comment' VARCHAR(160) DEFAULT NULL,\n\
-                       'customer' INTEGER DEFAULT 0,\n\
-                       'employee' INTEGER DEFAULT 0,\n\
-                       'is_company' INTEGER DEFAULT 0,\n\
-                       'debit' INTEGER DEFAULT 0,\n\
-                       'debit_limit' INTEGER DEFAULT 0,\n\
-                       'opportunity_count' INTEGER DEFAULT 0,\n\
-                       'contracts_count' INTEGER DEFAULT 0,\n\
-                       'journal_item_count' INTEGER DEFAULT 0,\n\
-                       'meeting_count' INTEGER DEFAULT 0,\n\
-                       'phonecall_count' INTEGER DEFAULT 0,\n\
-                       'sale_order_count' INTEGER DEFAULT NULL,\n\
-                       'total_invoiced' INTEGER DEFAULT NULL);");
-
-        db.executeSql("CREATE TABLE IF NOT EXISTS 'lead' (\n\
-                      'id' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n\
-                      'remote_id' INTEGER DEFAULT 0,\n\
-                      'modified' INTEGER DEFAULT 0,\n\
-                      'modifiedDate' TEXT DEFAULT CURRENT_TIMESTAMP,\n\
-                      'name' VARCHAR(35) DEFAULT NULL,\n\
-                      'description' VARCHAR(100) DEFAULT NULL,\n\
-                      'contact_name' VARCHAR(100) DEFAULT NULL,\n\
-                      'phone' VARCHAR(20) DEFAULT NULL,\n\
-                      'mobile' VARCHAR(20) DEFAULT NULL,\n\
-                      'fax' VARCHAR(20) DEFAULT NULL,\n\
-                      'street' VARCHAR(35) DEFAULT NULL,\n\
-                      'street2' VARCHAR(35) DEFAULT NULL,\n\
-                      'meeting_count' INTEGER DEFAULT 0,\n\
-                      'message_bounce' INTEGER DEFAULT 0,\n\
-                      'planned_cost' INTEGER DEFAULT 0,\n\
-                      'planned_revenue' INTEGER DEFAULT 0,\n\
-                      'priority' INTEGER DEFAULT 0,\n\
-                      'probability' INTEGER DEFAULT 0,\n\
-                      'type' VARCHAR(20) DEFAULT NULL,\n\
-                      'stage_id' INTEGER DEFAULT NULL,\n\
-                      'user_id' INTEGER DEFAULT 0,\n\
-                      'partner_id' INTEGER DEFAULT 0);");
-         
-        db.executeSql("CREATE TABLE IF NOT EXISTS 'crm_stage' (\n\
-                      'id' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n\
-                      'remote_id' INTEGER DEFAULT 0,\n\
-                      'modified' INTEGER DEFAULT 0,\n\
-                      'modified_date' TEXT DEFAULT CURRENT_TIMESTAMP,\n\
-                      'name' VARCHAR(35) DEFAULT NULL,\n\
-                      'probability' REAL DEFAULT 0,\n\
-                      'type' VARCHAR(100) DEFAULT 'both');");
-
-        configFactory(function (configuration) {
-            if (configuration) {
-                $state.go('app.main');
-            } else {
-                $state.go('configuration');
+    .run(function (
+        $ionicPlatform,
+        $state,
+        $cordovaSQLite,
+        $cordovaFile,
+        configFactory
+    ) {
+
+        $ionicPlatform.ready(function () {
+            if (window.cordova && window.cordova.plugins.Keyboard) {
+                cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
+                cordova.plugins.Keyboard.disableScroll(true);
+            }
+
+            if (window.StatusBar) {
+                StatusBar.overlaysWebView(false);
+                StatusBar.backgroundColorByHexString('#387ef5');
+            }
+
+            if (window.sqlitePlugin) {
+                db = sqlitePlugin.openDatabase({ name: 'odoo.db', location: 'default' });
+
+                $cordovaFile.readAsText(cordova.file.applicationDirectory, 'www/init.sql').then(function (query) {
+                    db.transaction(function (tx) {
+                        tx.executeSql(query);
+                    }, function (txErr) {
+                        console.log(txErr);
+                        ionic.Platform.exitApp();
+                    }, function () {
+                        console.log('DB ready')
+                    });
+                }).catch(function (readErr) {
+                    ionic.Platform.exitApp();
+                });
+
+                configFactory(function (configuration) {
+                    if (configuration) {
+                        $state.go('app.main');
+                    } else {
+                        $state.go('configuration');
+                    }
+                }, function (err) {
+                    $state.go('configuration');
+                });
             }
-        }, function (err) {
-            $state.go('configuration');
         });
-    });
-})
-
-.config(function (
-    $stateProvider,
-    $urlRouterProvider,
-    // $ionicConfigProvider,
-    $translateProvider,
-    $ionicFilterBarConfigProvider
-) {
-   
-    $stateProvider
-        .state('app', {
-            url: '/app',
-            abstract: true,
-            templateUrl: 'templates/menu.html'
-        })
-
-        .state('app.main', {
-            url: '/main',
-            views: {
-                'content': {
-                    templateUrl: 'templates/main.html',
-                    controller: 'MainController'
+    })
+
+    .config(function (
+        $stateProvider,
+        $urlRouterProvider,
+        $ionicConfigProvider,
+        $translateProvider,
+        $ionicFilterBarConfigProvider
+    ) {
+
+        $stateProvider
+            .state('app', {
+                url: '/app',
+                abstract: true,
+                templateUrl: 'templates/menu.html'
+            })
+
+            .state('app.main', {
+                url: '/main',
+                views: {
+                    'content': {
+                        templateUrl: 'templates/main.html',
+                        controller: 'MainController'
+                    }
                 }
-            }
-        })
-
-        .state('app.sales', {
-            url: '/sales',
-            views: {
-                'content': {
-                    templateUrl: 'templates/sales/sales.html',
-                    controller: 'SaleController'
+            })
+
+            .state('app.sales', {
+                url: '/sales',
+                views: {
+                    'content': {
+                        templateUrl: 'templates/sales/sales.html',
+                        controller: 'SaleController'
+                    }
                 }
-            }
-        })
-
-        .state('app.customers', {
-            url: '/customers',
-            views: {
-                'content': {
-                    templateUrl: 'templates/sales/customers.html',
-                    controller: 'CustomersController'
+            })
+
+            .state('app.customers', {
+                url: '/customers',
+                views: {
+                    'content': {
+                        templateUrl: 'templates/sales/customers.html',
+                        controller: 'CustomersController'
+                    }
                 }
-            }
-        })
-
-        .state('app.leads', {
-            url: '/leads',
-            views: {
-                'content': {
-                    templateUrl: 'templates/sales/leads.html',
-                    controller: 'LeadsController'
+            })
+
+            .state('app.leads', {
+                url: '/leads',
+                views: {
+                    'content': {
+                        templateUrl: 'templates/sales/leads.html',
+                        controller: 'LeadsController'
+                    }
                 }
-            }
-        })
-
-        .state('app.opportunities', {
-            url: '/opportunities',
-            views: {
-                'content': {
-                    templateUrl: 'templates/sales/opportunities.html',
-                    controller: 'OpportunitiesController'
+            })
+
+            .state('app.opportunities', {
+                url: '/opportunities',
+                views: {
+                    'content': {
+                        templateUrl: 'templates/sales/opportunities.html',
+                        controller: 'OpportunitiesController'
+                    }
                 }
-            }
-        })
-
-        .state('app.preferences', {
-            url: '/preferences',
-            views: {
-                'content': {
-                    templateUrl: 'templates/preferences.html',
-                    controller: 'PreferencesController'
+            })
+
+            .state('app.preferences', {
+                url: '/preferences',
+                views: {
+                    'content': {
+                        templateUrl: 'templates/preferences.html',
+                        controller: 'PreferencesController'
+                    }
                 }
-            }
-        })
-
-        .state('configuration', {
-            url: '/configuration',
-            templateUrl: 'templates/configuration.html',
-            controller: 'ConfigurationController'
+            })
+
+            .state('configuration', {
+                url: '/configuration',
+                templateUrl: 'templates/configuration.html',
+                controller: 'ConfigurationController'
+            });
+
+        $translateProvider.translations('es', {
+            Opportunities: 'Oportunidades',
+            New: 'Nuevo',
+            Dead: 'Muerto',
+            Qualification: 'Calificación',
+            Proposition: 'Propuesta',
+            Negotiation: 'Negociación',
+            Won: 'Ganado',
+            Lost: 'Perdido'
         });
-    
-     $translateProvider.translations('es', {
-        Opportunities: 'Oportunidades',
-        New: 'Nuevo',
-        Dead: 'Muerto',
-        Qualification: 'Calificación',
-        Proposition: 'Propuesta',
-        Negotiation: 'Negociación',
-        Won: 'Ganado',
-        Lost: 'Perdido'
-    });
-
-    // $urlRouterProvider.otherwise('/configuration');
 
-    // $ionicConfigProvider.tabs.position('bottom');
-    // $ionicConfigProvider.backButton.icon('ion-chevron-left');
+        $ionicConfigProvider.spinner.icon('ios');
 
-    $ionicFilterBarConfigProvider.theme('positive');
-    $ionicFilterBarConfigProvider.placeholder('Buscar');
+        $ionicFilterBarConfigProvider.theme('positive');
+        $ionicFilterBarConfigProvider.placeholder('Buscar');
 
-    // $translateProvider.useSanitizeValueStrategy('sanitize');
-    $translateProvider.useSanitizeValueStrategy('escape');
-    $translateProvider.preferredLanguage('es');
-    $translateProvider.fallbackLanguage('es');
-
-});
+        $translateProvider.useSanitizeValueStrategy('escape');
+        $translateProvider.preferredLanguage('es');
+        $translateProvider.fallbackLanguage('es');
+    });

+ 3 - 11
www/js/controllers/customer.controller.js

@@ -9,19 +9,12 @@ angular.module('odoo')
     customersStorageFactory,
     sqlFactory,
     cameraFactory,
-    contactFactory,
-    $ionicPopover
+    contactFactory
 ) {
     $scope.loading = false;
     $scope.customers = [];
     $scope.customer = {};
 
-    $ionicPopover.fromTemplateUrl('templates/options.html', {
-        scope: $scope,
-    }).then(function(popover) {
-        $scope.popover = popover;
-    });
-
     $ionicModal.fromTemplateUrl('templates/sales/customer.html', {
         scope: $scope,
         animation: 'slide-in-up'
@@ -174,9 +167,8 @@ angular.module('odoo')
     }
 
     // Show customer data in modal
-    $scope.show = function (e) {
-        // $scope.customerModal.show();
-        $scope.popover.show(e);
+    $scope.show = function () {
+        $scope.customerModal.show();
     }
 
     // Take a picture from camera for customer profile

+ 4 - 1
www/js/controllers/lead.controller.js

@@ -6,6 +6,7 @@ angular.module('odoo')
     $ionicActionSheet,
     $ionicFilterBar,
     $ionicPopup,
+    $cordovaVibration,
     leadsRemoteFactory,
     leadsStorageFactory,
     opportunitiesStorageFactory,
@@ -94,7 +95,7 @@ angular.module('odoo')
     }
 
     $scope.show = function (event) {
-        // $scope.leadModal.show();
+        $scope.leadModal.show();
     }
 
     $scope.save = function () {
@@ -164,6 +165,8 @@ angular.module('odoo')
     }
 
     $scope.openOptions = function (index) {
+        $cordovaVibration.vibrate(100);
+        
         if (index == -1) {
             $scope.lead = {};
         } else {

+ 4 - 4
www/js/factories/sales/lead.storage.factory.js

@@ -4,9 +4,9 @@ angular.module('odoo')
 
     // Save lead data to local storage
     var save = function (lead, success, error) {
+        
         var values = [
                         lead.remote_id ? lead.remote_id : 0,
-                        1,
                         lead.name ? lead.name : '',
                         lead.description ? lead.description : '',
                         lead.contact_name ? lead.contact_name : '',
@@ -22,7 +22,7 @@ angular.module('odoo')
                         lead.priority ? lead.priority : 2,
                         lead.probability ? lead.probability : 0,
                         lead.type ? lead.type : 'lead',
-                        lead.stage_id ? lead.stage_id : 0,
+                        typeof lead.stage_id == 'number' ? lead.stage_id : parseInt(lead.stage_id.split(',')[0]),
                         lead.user_id ? lead.user_id : 0,
                         lead.partner_id ? lead.partner_id : 0
                     ];
@@ -34,7 +34,7 @@ angular.module('odoo')
 
             sql = 'UPDATE lead SET ' +
                   'remote_id = ?,' +
-                  'modified = ?,' +
+                  'modified = 1,' +
                   'modifiedDate = CURRENT_TIMESTAMP,' +
                   'name = ?,' +
                   'description = ?,' +
@@ -77,7 +77,7 @@ angular.module('odoo')
                 'stage_id,' +
                 'user_id,' +
                 'partner_id) ' +
-                'VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
+                'VALUES(?, 0, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
         }
 
         db.executeSql(sql, values, function (result) {

+ 4 - 0
www/js/factories/sales/lead.sync.factory.js

@@ -58,8 +58,10 @@ angular.module('odoo')
                             if (localDate > remoteDate) {
 
                                 odooInteroperabilityFactory.write('crm.lead', id, data, configuration, function (response) {
+                                    console.log(response);
                                     success(response);
                                 }, function (odooErr) {
+                                    console.log(odooErr);
                                     error(odooErr);
                                 });
 
@@ -143,6 +145,8 @@ angular.module('odoo')
                 asyncLoopFactory(updatedLeads.length, function (loop) {
                     var data = updatedLeads.item(loop.iteration());
 
+                    console.log(data);
+
                     push(data.remote_id, data, function (response) {
                         loop.next();
                     }, function (pushErr) {

+ 48 - 43
www/js/factories/sales/opportunity.sync.factory.js

@@ -1,10 +1,10 @@
 angular.module('odoo')
 
-     /**
-     * -----------------------------------------------------------------------------
-     *  Description:    Local storage manager for crm stage data
-     * -----------------------------------------------------------------------------
-     */    
+    /**
+    * -----------------------------------------------------------------------------
+    *  Description:    Local storage manager for crm stage data
+    * -----------------------------------------------------------------------------
+    */
     .factory('opportunitiesDataFactory', function (
         opportunitiesStorageFactory,
         leadsRemoteFactory,
@@ -18,7 +18,7 @@ angular.module('odoo')
          *
          */
         var pull = function (id, success, error) {
-            configFactory(function (configuration) { 
+            configFactory(function (configuration) {
                 if (id) {
 
                     odooInteroperabilityFactory.read('crm.lead', [['id', '=', id]], configuration, function (response) {
@@ -26,16 +26,16 @@ angular.module('odoo')
                     }, function (odooErr) {
                         error(odooErr);
                     });
-                    
+
                 } else {
 
-                    odooInteroperabilityFactory.read('crm.lead', [['type', '=', 'opportunity']], configuration, function (response) { 
+                    odooInteroperabilityFactory.read('crm.lead', [['type', '=', 'opportunity']], configuration, function (response) {
                         success(response);
                     }, function (odooErr) {
                         error(odooErr);
                     });
                 }
-            }, function(configErr) {
+            }, function (configErr) {
                 error(configErr);
             });
         }
@@ -44,9 +44,9 @@ angular.module('odoo')
          *
          */
         var push = function (id, data, success, error) {
-            leadsRemoteFactory.push(id, data, function (response) { 
+            leadsRemoteFactory.push(id, data, function (response) {
                 success(response);
-            }, function (err) { 
+            }, function (err) {
                 error(err);
             });
         }
@@ -55,9 +55,9 @@ angular.module('odoo')
          *
          */
         var destroy = function (id, success, error) {
-            leadsRemoteFactory.destroy(id, function (response) { 
+            leadsRemoteFactory.destroy(id, function (response) {
                 success(response);
-            }, function (err) { 
+            }, function (err) {
                 error(err);
             });
         }
@@ -67,7 +67,7 @@ angular.module('odoo')
          */
         var get = function (constraint, success, error) {
             sqlFactory.selectByConstraint('lead', constraint, function (leads) {
-                 success(leads);
+                success(leads);
             }, function (err) {
                 error(err);
             });
@@ -77,7 +77,7 @@ angular.module('odoo')
          *
          */
         var getAll = function (success, error) {
-            get("type = 'opportunity' AND modified != 2", function (opportunities) { 
+            get("type = 'opportunity' AND modified != 2", function (opportunities) {
                 var data = [];
 
                 for (var i = 0; i < opportunities.length; i++) {
@@ -94,18 +94,18 @@ angular.module('odoo')
          *
          */
         var syncNewData = function (success, error) {
-            get("remote_id = 0 AND type = 'opportunity'", function (newOpportunities) { 
-                asyncLoopFactory(newOpportunities.length, function (loop) { 
+            get("remote_id = 0 AND type = 'opportunity'", function (newOpportunities) {
+                asyncLoopFactory(newOpportunities.length, function (loop) {
                     var data = newOpportunities.item(loop.iteration());
 
-                    push(null, data, function (response) { 
+                    push(null, data, function (response) {
                         loop.next();
-                    }, function (pushErr) { 
+                    }, function (pushErr) {
                         loop.next();
                     });
-                
-                // end loop
-                }, function () { 
+
+                    // end loop
+                }, function () {
                     success(newOpportunities);
                 });
             }, function (getErr) {
@@ -121,13 +121,15 @@ angular.module('odoo')
                 asyncLoopFactory(updatedOpportunities.length, function (loop) {
                     var data = updatedOpportunities.item(loop.iteration());
 
-                    push(data.remote_id, data, function (response) { 
+                    console.log(data);
+
+                    push(data.remote_id, data, function (response) {
                         loop.next();
-                    }, function (pushErr) { 
+                    }, function (pushErr) {
                         loop.next();
-                        });
-                    
-                // end loop
+                    });
+
+                    // end loop
                 }, function () {
                     success(updatedOpportunities);
                 });
@@ -136,19 +138,22 @@ angular.module('odoo')
             });
         }
 
+        /**
+         *
+         */
         var syncDeletedData = function (success, error) {
-            get("remote_id != 0 AND modified = 2 AND type = 'opportunity'", function (deletedOpportunities) { 
-                asyncLoopFactory(deletedOpportunities.length, function (loop) { 
+            get("remote_id != 0 AND modified = 2 AND type = 'opportunity'", function (deletedOpportunities) {
+                asyncLoopFactory(deletedOpportunities.length, function (loop) {
                     var id = deletedOpportunities.item(loop.iteration()).remote_id;
 
-                    destroy(id, function (response) { 
+                    destroy(id, function (response) {
                         loop.next();
                     }, function (destroyErr) {
                         loop.next();
                     });
-                
-                // end loop
-                }, function () { 
+
+                    // end loop
+                }, function () {
                     success(deletedOpportunities);
                 });
             }, function (getErr) {
@@ -160,10 +165,10 @@ angular.module('odoo')
          *
          */
         var downloadSyncData = function (success, error) {
-            pull(null, function (opportunities) { 
-                
-                opportunitiesStorageFactory.removeAll(function () { 
-                    asyncLoopFactory(opportunities.length, function (loop) { 
+            pull(null, function (opportunities) {
+
+                opportunitiesStorageFactory.removeAll(function () {
+                    asyncLoopFactory(opportunities.length, function (loop) {
                         var data = opportunities[loop.iteration()];
 
                         data.remote_id = data.id;
@@ -172,9 +177,9 @@ angular.module('odoo')
                         opportunitiesStorageFactory.save(data, function (opportunity) {
                             loop.next();
                         }, function (saveErr) {
-                             loop.next();
+                            loop.next();
                         });
-                        
+
                     }, function () {
                         success(opportunities);
                     });
@@ -182,7 +187,7 @@ angular.module('odoo')
                     error(removeAllErr);
                 });
 
-            }, function (pullErr) { 
+            }, function (pullErr) {
                 error(pullErr);
             });
         }
@@ -191,7 +196,7 @@ angular.module('odoo')
          *
          */
         var sync = function (success, error) {
-            syncNewData(function () { 
+            syncNewData(function () {
                 console.log('opportunities --> new data ok');
 
                 syncUpdatedData(function () {
@@ -200,7 +205,7 @@ angular.module('odoo')
                     syncDeletedData(function () {
                         console.log('opportunities --> deleted data ok');
 
-                        downloadSyncData(function (data) { 
+                        downloadSyncData(function (data) {
                             console.log('opportunities --> download data ok');
 
                             success(data);
@@ -224,6 +229,6 @@ angular.module('odoo')
             destroy: destroy,
             getAll: getAll,
             sync: sync
-            
+
         }
     });

+ 3 - 4
www/templates/sales/customers.html

@@ -1,14 +1,13 @@
 <ion-view title="Clientes">
 
     <ion-nav-buttons side="right">
-        <!--<button class="button button-clear ion-plus-round bar-icon" ng-click="show()"></i></button>-->
-        <button class="button button-clear ion-plus-round bar-icon" ng-click="show($event)"></i></button>
+        <button class="button button-clear ion-plus-round bar-icon" ng-click="show()"></i></button>
     </ion-nav-buttons>
 
     <ion-content>
 
-        <ion-refresher pulling-text="Actualizar" on-refresh="fill(true)" spinner="lines"></ion-refresher>
-        <ion-spinner class="centered-spinner" ng-show="loading" icon="lines"></ion-spinner>
+        <ion-refresher pulling-text="Actualizar" on-refresh="fill(true)"></ion-refresher>
+        <ion-spinner class="centered-spinner" ng-show="loading"></ion-spinner>
 
         <ion-list type="card" ng-show="!customers || customers.length != 0">
           <ion-item class="item-avatar" on-hold="openOptions($index)" ng-repeat="c in customers">

+ 4 - 4
www/templates/sales/leads.html

@@ -1,14 +1,14 @@
 <ion-view title="Iniciativas">
 
     <ion-nav-buttons side="right">
-        <button class="button button-clear ion-search" style="font-size:22px !important; padding-right: 5px;" ng-click="toggleSearch()"></i></button>
-        <button class="button button-clear ion-plus-round" style="font-size:22px !important;  padding-left: 5px;" ng-click="show()"></i></button>
+        <button class="button button-clear ion-search bar-icon" ng-click="toggleSearch()"></i></button>
+        <button class="button button-clear ion-plus-round bar-icon" ng-click="show()"></i></button>
     </ion-nav-buttons>
 
     <ion-content>
 
-        <ion-refresher pulling-text="Actualizar" on-refresh="fill(true)" spinner="lines"></ion-refresher>
-        <ion-spinner class="centered-spinner" ng-show="loading" icon="lines"></ion-spinner>
+        <ion-refresher pulling-text="Actualizar" on-refresh="fill(true)"></ion-refresher>
+        <ion-spinner class="centered-spinner" ng-show="loading"></ion-spinner>
 
         <ion-list type="card" ng-show="!leads || leads.length != 0">
           <ion-item assertive on-hold="openOptions($index)" ng-repeat="l in leads">

+ 1 - 1
www/templates/sales/opportunities.html

@@ -7,7 +7,7 @@
 
     <ion-content delegate-handle="mainScroll">
 
-        <ion-spinner class="centered-spinner" ng-show="loading" icon="lines"></ion-spinner>
+        <ion-spinner class="centered-spinner" ng-show="loading"></ion-spinner>
 
         <ion-slides ng-show="!loading" on-swipe-left="changeStage(0)" on-swipe-right="changeStage(1)" slider="data.slider">
             <ion-slide-page ng-repeat="s in stages">