Browse Source

opportunity slide view bug resolved and stage id field added to database

robert2206 8 years ago
parent
commit
07e9964dd8

+ 20 - 8
www/css/app.css

@@ -69,16 +69,28 @@
   fill: #387ef5;
 }
 
-.scroll {
-    height:100%;
+.animate-repeat {
+  line-height:30px;
+  list-style:none;
+  box-sizing:border-box;
 }
 
-.slider{
-  height:100vh;
-  width:auto;
+.animate-repeat.ng-move,
+.animate-repeat.ng-enter,
+.animate-repeat.ng-leave {
+  transition:all linear 0.1s;
 }
 
-.slider-slide {
-  height: 100vh;
-  width: auto;
+.animate-repeat.ng-leave.ng-leave-active,
+.animate-repeat.ng-move,
+.animate-repeat.ng-enter {
+  opacity:0;
+  max-height:0;
 }
+
+.animate-repeat.ng-leave,
+.animate-repeat.ng-move.ng-move-active,
+.animate-repeat.ng-enter.ng-enter-active {
+  opacity:1;
+  max-height:30px;
+}

+ 1 - 0
www/js/app.js

@@ -87,6 +87,7 @@ angular.module(
                       '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);");
          

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

@@ -9,12 +9,19 @@ angular.module('odoo')
     customersStorageFactory,
     sqlFactory,
     cameraFactory,
-    contactFactory
+    contactFactory,
+    $ionicPopover
 ) {
     $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'
@@ -167,8 +174,9 @@ angular.module('odoo')
     }
 
     // Show customer data in modal
-    $scope.show = function () {
-        $scope.customerModal.show();
+    $scope.show = function (e) {
+        // $scope.customerModal.show();
+        $scope.popover.show(e);
     }
 
     // Take a picture from camera for customer profile

+ 3 - 2
www/js/controllers/lead.controller.js

@@ -21,6 +21,7 @@ angular.module('odoo')
     };
     $scope.search = null;
 
+
     $ionicModal.fromTemplateUrl('templates/sales/lead.html', {
         scope: $scope,
         animation: 'slide-in-up'
@@ -92,8 +93,8 @@ angular.module('odoo')
         });
     }
 
-    $scope.show = function () {
-        $scope.leadModal.show();
+    $scope.show = function (event) {
+        // $scope.leadModal.show();
     }
 
     $scope.save = function () {

+ 12 - 14
www/js/controllers/opportunity.controller.js

@@ -7,7 +7,6 @@ angular.module('odoo')
         $scope,
         $ionicActionSheet,
         $ionicPopup,
-        $ionicScrollDelegate,
         crmStagesDataFactory,
         opportunitiesDataFactory,
         ionicToast
@@ -23,7 +22,7 @@ angular.module('odoo')
         /**
          *
          */
-        $scope.$on("$ionicSlides.sliderInitialized", function (event, data){
+        $scope.$on("$ionicSlides.sliderInitialized", function (event, data) {
             $scope.slider = data.slider;
         });
 
@@ -50,16 +49,15 @@ angular.module('odoo')
             $scope.getStages(function (stages) {
 
                 $scope.slider.updateLoop();
-                $scope.getOpportunities(function (opportunities) { 
+                $scope.getOpportunities(function (opportunities) {
                     console.log(opportunities);
 
                     $scope.loading = false;
-                    console.log($ionicScrollDelegate.$getByHandle('mainScroll').getScrollView());
                     $scope.$apply();
-                }, function (err) { 
+                }, function (err) {
                     $scope.loading = false;
                 });
-                
+
             }, function (err) {
                 $scope.loading = false;
             });
@@ -90,16 +88,16 @@ angular.module('odoo')
          *
          */
         $scope.getOpportunities = function (success, error) {
-            opportunitiesDataFactory.sync(function (opportunities) { 
+            opportunitiesDataFactory.sync(function (opportunities) {
                 $scope.opportunities = opportunities;
 
                 success(opportunities);
-            }, function (syncErr) { 
-                opportunitiesDataFactory.getAll(function (opportunities) { 
+            }, function (syncErr) {
+                opportunitiesDataFactory.getAll(function (opportunities) {
                     $scope.opportunities = opportunities;
 
                     success(opportunities);
-                }, function (getAllErr) { 
+                }, function (getAllErr) {
                     error(getAllErr);
                 });
             });
@@ -128,7 +126,7 @@ angular.module('odoo')
 
             $scope.currentStage = $scope.stages[index];
 
-            if(!$scope.$$phase) {
+            if (!$scope.$$phase) {
                 $scope.$apply();
             }
         }
@@ -193,11 +191,11 @@ angular.module('odoo')
                     }
                 ],
                 destructiveText: '<i class="icon ion-trash-a assertive"></i> Eliminar',
-                cancel: function() {
+                cancel: function () {
                     $scope.customer = {};
                     $scope.selected = -1;
                 },
-                buttonClicked: function(index) {
+                buttonClicked: function (index) {
                     switch (index) {
                         case 0:
                             $scope.show();
@@ -210,7 +208,7 @@ angular.module('odoo')
                     }
                     return true;
                 },
-                destructiveButtonClicked: function() {
+                destructiveButtonClicked: function () {
                     $scope.delete();
 
                     return true;

+ 25 - 19
www/js/factories/sales/lead.storage.factory.js

@@ -22,6 +22,8 @@ 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,
+                        lead.user_id ? lead.user_id : 0,
                         lead.partner_id ? lead.partner_id : 0
                     ];
 
@@ -49,29 +51,33 @@ angular.module('odoo')
                   'priority = ?,' +
                   'probability = ?,' +
                   'type = ?,' +
+                  'stage_id = ?,' +
+                  'user_id = ?,' +
                   'partner_id = ? ' +
                   'WHERE id = ?';
         } else {
             sql = 'INSERT INTO lead(' +
-                  'remote_id,' +
-                  'modified,' +
-                  'name,' +
-                  'description,' +
-                  'contact_name,' +
-                  'phone,' +
-                  'mobile,' +
-                  'fax,' +
-                  'street,' +
-                  'street2,' +
-                  'meeting_count,' +
-                  'message_bounce,' +
-                  'planned_cost,' +
-                  'planned_revenue,' +
-                  'priority,' +
-                  'probability,' +
-                  'type,' +
-                  'partner_id) ' +
-                  'VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
+                'remote_id,' +
+                'modified,' +
+                'name,' +
+                'description,' +
+                'contact_name,' +
+                'phone,' +
+                'mobile,' +
+                'fax,' +
+                'street,' +
+                'street2,' +
+                'meeting_count,' +
+                'message_bounce,' +
+                'planned_cost,' +
+                'planned_revenue,' +
+                'priority,' +
+                'probability,' +
+                'type,' +
+                'stage_id,' +
+                'user_id,' +
+                'partner_id) ' +
+                'VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
         }
 
         db.executeSql(sql, values, function (result) {

+ 187 - 187
www/js/factories/sales/lead.sync.factory.js

@@ -1,232 +1,235 @@
 angular.module('odoo')
 
-.factory('leadsRemoteFactory', function (
-    leadsStorageFactory,
-    odooInteroperabilityFactory,
-    configFactory,
-    sqlFactory,
-    asyncLoopFactory
-) {
-
-    // Pull server leads data
-    var pull = function (id, success, error) {
-        configFactory(function (configuration) {
-            if (id) {
-
-                odooInteroperabilityFactory.read('crm.lead', [['id', '=', id]], configuration, function (response) {
-                    success(response);
-                }, function (odooErr) {
-                    error(odooErr)
-                });
+    .factory('leadsRemoteFactory', function (
+        leadsStorageFactory,
+        odooInteroperabilityFactory,
+        configFactory,
+        sqlFactory,
+        asyncLoopFactory
+    ) {
+
+        // Pull server leads data
+        var pull = function (id, success, error) {
+            configFactory(function (configuration) {
+                if (id) {
+
+                    odooInteroperabilityFactory.read('crm.lead', [['id', '=', id]], configuration, function (response) {
+                        success(response);
+                    }, function (odooErr) {
+                        error(odooErr)
+                    });
 
-            } else {
+                } else {
 
-                odooInteroperabilityFactory.read('crm.lead', [['type', '=', 'lead']], configuration, function (response) {
-                    success(response);
-                }, function (odooErr) {
-                    error(odooErr);
-                });
+                    odooInteroperabilityFactory.read('crm.lead', [['type', '=', 'lead']], configuration, function (response) {
+                        success(response);
+                    }, function (odooErr) {
+                        error(odooErr);
+                    });
+
+                }
+            }, function (configErr) {
+                error(configErr);
+            });
+        }
 
-            }
-        }, function (configErr) {
-            error(configErr);
-        });
-    }
+        // Push leads data to server
+        var push = function (id, data, success, error) {
 
-    // Push leads data to server
-    var push = function (id, data, success, error) {
+            // Avoid odoo server warning message
+            delete data.id;
+            delete data.remote_id;
+            delete data.modified;
+            delete data.priority;
 
-        // Avoid odoo server warning message
-        delete data.id;
-        delete data.remote_id;
-        delete data.modified;
-        delete data.priority;
+            configFactory(function (configuration) {
 
-        configFactory(function (configuration) {
+                if (id) {
 
-            if (id) {
+                    pull(id, function (response) {
+                        if (response.length == 1) {
+                            var remoteData = response[0];
 
-                pull(id, function (response) {
-                    if (response.length == 1) {
-                        var remoteData = response[0];
+                            var remoteDate = new Date(remoteData.__last_update);
+                            var localDate = new Date(data.modifiedDate);
 
-                        var remoteDate = new Date(remoteData.__last_update);
-                        var localDate = new Date(data.modifiedDate);
+                            delete data.modifiedDate;
 
-                        delete data.modifiedDate;
+                            if (localDate > remoteDate) {
 
-                        if (localDate > remoteDate) {
+                                odooInteroperabilityFactory.write('crm.lead', id, data, configuration, function (response) {
+                                    success(response);
+                                }, function (odooErr) {
+                                    error(odooErr);
+                                });
 
-                            odooInteroperabilityFactory.write('crm.lead', id, data, configuration, function (response) {
+                            } else {
                                 success(response);
-                            }, function (odooErr) {
-                                error(odooErr);
-                            });
+                            }
 
                         } else {
-                            console.log('No Actualizar');
                             success(response);
                         }
 
-                    } else {
+                    }, function (pullErr) {
+                        error(pullErr);
+                    });
+
+                } else {
+
+                    delete data.modifiedDate;
+
+                    odooInteroperabilityFactory.create('crm.lead', data, configuration, function (response) {
                         success(response);
-                    }
+                    }, function (odooErr) {
+                        error(odooErr);
+                    });
 
-                }, function (pullErr) {
-                    error(pullErr);
-                });
+                }
 
-            } else {
+            }, function (configErr) {
+                error(configErr);
+            });
+        }
 
-                delete data.modifiedDate;
+        // Destroy server lead data
+        var destroy = function (id, success, error) {
+            configFactory(function (configuration) {
 
-                odooInteroperabilityFactory.create('crm.lead', data, configuration, function (response) {
+                odooInteroperabilityFactory.unlink('crm.lead', id, configuration, function (response) {
                     success(response);
                 }, function (odooErr) {
                     error(odooErr);
                 });
 
-            }
+            }, function (configErr) {
+                error(configErr);
+            });
+        }
+
+        // Get local lead data
+        var get = function (contraint, success, error) {
+            sqlFactory.selectByConstraint('lead', contraint, function (leads) {
+                success(leads);
+            }, function (err) {
+                error(err);
+            });
+        }
 
-        }, function (configErr) {
-            error(configErr);
-        });
-    }
+        // Send all new data from local to remote server
+        var syncNewData = function (success, error) {
+            get('remote_id = 0', function (newLeads) {
+                asyncLoopFactory(newLeads.length, function (loop) {
+                    var data = newLeads.item(loop.iteration());
 
-    // Destroy server lead data
-    var destroy = function (id, success, error) {
-        configFactory(function (configuration) {
+                    push(null, data, function (response) {
+                        loop.next();
+                    }, function (pushErr) {
+                        loop.next();
+                    });
 
-            odooInteroperabilityFactory.unlink('crm.lead', id, configuration, function (response) {
-                success(response);
-            }, function (odooErr) {
-                error(odooErr);
+                    // End loop
+                }, function () {
+                    success(newLeads);
+                });
+            }, function (getErr) {
+                error(getErr);
             });
+        }
 
-        }, function (configErr) {
-            error(configErr);
-        });
-    }
-
-    // Get local lead data
-    var get = function (contraint, success, error) {
-        sqlFactory.selectByConstraint('lead', contraint, function (leads) {
-            success(leads);
-        }, function (err) {
-            error(err);
-        });
-    }
-
-    // Send all new data from local to remote server
-    var syncNewData = function (success, error) {
-        get('remote_id = 0', function (newLeads) {
-            asyncLoopFactory(newLeads.length, function (loop) {
-                var data = newLeads.item(loop.iteration());
-
-                push(null, data, function (response) {
-                    loop.next();
-                }, function (pushErr) {
-                    loop.next();
-                });
+        // Update all data from server
+        var syncUpdatedData = function (success, error) {
+            get("remote_id != 0 AND modified = 1", function (updatedLeads) {
+                asyncLoopFactory(updatedLeads.length, function (loop) {
+                    var data = updatedLeads.item(loop.iteration());
 
-            // End loop
-            }, function () {
-                success(newLeads);
-            });
-        }, function (getErr) {
-            error(getErr);
-        });
-    }
-
-    // Update all data from server
-    var syncUpdatedData = function (success, error) {
-        get("remote_id != 0 AND modified = 1", function (updatedLeads) {
-            asyncLoopFactory(updatedLeads.length, function (loop) {
-                var data = updatedLeads.item(loop.iteration());
-
-                push(data.remote_id, data, function (response) {
-                    loop.next();
-                }, function (pushErr) {
-                    loop.next();
-                });
+                    push(data.remote_id, data, function (response) {
+                        loop.next();
+                    }, function (pushErr) {
+                        loop.next();
+                    });
 
-            // End loop
-            }, function () {
-                success(updatedLeads);
-            });
-        }, function(getErr) {
-            error(getErr);
-        });
-    }
-
-    // Delete all data
-    var syncDeletedData = function (success, error) {
-        get('remote_id != 0 AND modified = 2', function (deletedLeads) {
-            asyncLoopFactory(deletedLeads.length, function (loop) {
-                var id = deletedLeads.item(loop.iteration()).remote_id;
-
-                destroy(id, function (response) {
-                    loop.next();
-                }, function (destroyErr) {
-                    loop.next();
+                    // End loop
+                }, function () {
+                    success(updatedLeads);
                 });
-
-            // End loop
-            }, function () {
-                success(deletedLeads);
+            }, function (getErr) {
+                error(getErr);
             });
-        }, function (getErr) {
-            error(getErr);
-        });
-    }
+        }
 
-    // Download all sync data from server
-    var downloadSyncData = function (success, error) {
-        pull(null, function (leads) {
+        // Delete all data
+        var syncDeletedData = function (success, error) {
+            get('remote_id != 0 AND modified = 2', function (deletedLeads) {
+                asyncLoopFactory(deletedLeads.length, function (loop) {
+                    var id = deletedLeads.item(loop.iteration()).remote_id;
 
-            leadsStorageFactory.removeAll(function () {
-                asyncLoopFactory(leads.length, function (loop) {
-                    var data = leads[loop.iteration()];
-
-                    data.remote_id = data.id;
-                    delete data.id;
-
-                    leadsStorageFactory.save(data, function (leadId) {
+                    destroy(id, function (response) {
                         loop.next();
-                    }, function (saveErr) {
+                    }, function (destroyErr) {
                         loop.next();
                     });
 
-                // End loop
+                    // End loop
                 }, function () {
-                    success(leads);
+                    success(deletedLeads);
+                });
+            }, function (getErr) {
+                error(getErr);
+            });
+        }
+
+        // Download all sync data from server
+        var downloadSyncData = function (success, error) {
+            pull(null, function (leads) {
+
+                leadsStorageFactory.removeAll(function () {
+                    asyncLoopFactory(leads.length, function (loop) {
+                        var data = leads[loop.iteration()];
+
+                        data.remote_id = data.id;
+                        delete data.id;
+
+                        leadsStorageFactory.save(data, function (leadId) {
+                            loop.next();
+                        }, function (saveErr) {
+                            loop.next();
+                        });
+
+                        // End loop
+                    }, function () {
+                        success(leads);
+                    });
+
+                }, function (removeAllErr) {
+                    error(removeAllErr);
                 });
 
-            }, function (removeAllErr) {
-                error(removeAllErr);
+            }, function (pushErr) {
+                error(pushErr);
             });
+        }
 
-        }, function (pushErr) {
-            error(pushErr);
-        });
-    }
+        // Sync all leads data between local and remote data
+        var sync = function (success, error) {
+            syncNewData(function () {
 
-    // Sync all leads data between local and remote data
-    var sync = function (success, error) {
-        syncNewData(function () {
+                console.log("leads --> new data ok");
+                syncUpdatedData(function () {
 
-            // console.log("New data ok");
-            syncUpdatedData(function () {
+                    console.log("leads --> updated data ok");
+                    syncDeletedData(function () {
 
-                // console.log("Updated data ok");
-                syncDeletedData(function () {
+                        console.log("leads -> deleted data ok");
+                        downloadSyncData(function (data) {
 
-                    // console.log("Deleted data ok");
-                    downloadSyncData(function (data) {
-                        // console.log("Download data ok");
-                        success(data);
-                    }, function (downloadErr) {
-                        error(downloadErr);
+                            console.log("leads -> download data ok");
+                            success(data);
+                        }, function (downloadErr) {
+                            error(downloadErr);
+                        });
+                    }, function (syncErr) {
+                        error(syncErr);
                     });
                 }, function (syncErr) {
                     error(syncErr);
@@ -234,15 +237,12 @@ angular.module('odoo')
             }, function (syncErr) {
                 error(syncErr);
             });
-        }, function (syncErr) {
-            error(syncErr);
-        });
-    }
-
-    return {
-        pull: pull,
-        push: push,
-        destroy: destroy,
-        sync: sync
-    }
-});
+        }
+
+        return {
+            pull: pull,
+            push: push,
+            destroy: destroy,
+            sync: sync
+        }
+    });

+ 54 - 109
www/js/factories/sales/opportunity.storage.factory.js

@@ -1,116 +1,61 @@
 angular.module('odoo')
 
-.factory('opportunitiesStorageFactory', function () {
-
-    var save = function (opportunity, success, error) {
-        var values = [
-                        opportunity.remote_id ? opportunity.remote_id : 0,
-                        1,
-                        opportunity.name ? opportunity.name : '',
-                        opportunity.description ? opportunity.description : '',
-                        opportunity.contact_name ? opportunity.contact_name : '',
-                        opportunity.phone ? opportunity.phone : '',
-                        opportunity.mobile ? opportunity.mobile : '',
-                        opportunity.fax ? opportunity.fax : '',
-                        opportunity.street ? opportunity.street : '',
-                        opportunity.street2 ? opportunity.street2 : '',
-                        opportunity.meeting_count ? opportunity.meeting_count : 0,
-                        opportunity.message_bounce ? opportunity.message_bounce : 0,
-                        opportunity.planned_cost ? opportunity.planned_cost : 0,
-                        opportunity.planned_revenue ? opportunity.planned_revenue : 0,
-                        opportunity.priority ? opportunity.priority : 2,
-                        opportunity.probability ? opportunity.probability : 0,
-                        (opportunity.type == undefined || opportunity.type == 'lead') ?  'opportunity' : opportunity.type,
-                        opportunity.partner_id ? opportunity.partner_id : 0
-                    ];
-
-        var sql = null;
-
-        if (opportunity.id) {
-            values.push(opportunity.id);
-
-            sql = 'UPDATE lead SET ' +
-                  'remote_id = ?,' +
-                  'modified = ?,' +
-                  'modifiedDate = CURRENT_TIMESTAMP,' +
-                  'name = ?,' +
-                  'description = ?,' +
-                  'contact_name = ?,' +
-                  'phone = ?,' +
-                  'mobile = ?,' +
-                  'fax = ?,' +
-                  'street = ?,' +
-                  'street2 = ?,' +
-                  'meeting_count = ?,' +
-                  'message_bounce = ?,' +
-                  'planned_cost = ?,' +
-                  'planned_revenue = ?,' +
-                  'priority = ?,' +
-                  'probability = ?,' +
-                  'type = ?,' +
-                  'partner_id = ? ' +
-                  'WHERE id = ?';
-        } else {
-            sql = 'INSERT INTO lead(' +
-                  'remote_id,' +
-                  'modified,' +
-                  'name,' +
-                  'description,' +
-                  'contact_name,' +
-                  'phone,' +
-                  'mobile,' +
-                  'fax,' +
-                  'street,' +
-                  'street2,' +
-                  'meeting_count,' +
-                  'message_bounce,' +
-                  'planned_cost,' +
-                  'planned_revenue,' +
-                  'priority,' +
-                  'probability,' +
-                  'type,' +
-                  'partner_id) ' +
-                  'VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
+    /**
+     *
+     */
+    .factory('opportunitiesStorageFactory', function (
+        leadsStorageFactory
+    ) {
+
+        /**
+         *
+         */
+        var save = function (opportunity, success, error) {
+            opportunity.type = 'opportunity';
+
+            leadsStorageFactory.save(opportunity, function (opportunityId) {
+                success(opportunityId);
+            }, function (saveErr) {
+                error(saveErr);
+            });
         }
 
-        db.executeSql(sql, values, function (result) {
-            success(sql.startsWith('INSERT') ? result.insertId : opportunity.id);
-        }, function (err) {
-            error(err);
-        });
-    }
-
-    // Remove opportunity from local storage
-    var remove = function (opportunity, success, error) {
-        var values = [opportunity.id];
-        var sql = null;
-
-        if (opportunity.remote_id) {
-            sql = 'UPDATE lead SET modified = 2 WHERE id = ?';
-        } else {
-            sql = 'DELETE FROM lead WHERE id = ?'
+        /**
+         *
+         */
+        var remove = function (opportunity, success, error) {
+            var values = [opportunity.id];
+            var sql = null;
+
+            if (opportunity.remote_id) {
+                sql = 'UPDATE lead SET modified = 2 WHERE id = ?';
+            } else {
+                sql = 'DELETE FROM lead WHERE id = ?'
+            }
+
+            db.executeSql(sql, values, function (result) {
+                success(result.rowsAffected);
+            }, function (err) {
+                error(err);
+            });
         }
 
-        db.executeSql(sql, values, function (result) {
-            success(result.rowsAffected);
-        }, function(err) {
-            error(err);
-        });
-    }
-
-    var removeAll = function (success, error) {
-        var sql = "DELETE FROM lead WHERE type = 'opportunity'";
-
-        db.executeSql(sql, [], function(result) {
-            success(result.rowsAffected);
-        }, function(err) {
-            error(err);
-        });
-    }
+        /**
+         *
+         */
+        var removeAll = function (success, error) {
+            var sql = "DELETE FROM lead WHERE type = 'opportunity'";
+
+            db.executeSql(sql, [], function (result) {
+                success(result.rowsAffected);
+            }, function (err) {
+                error(err);
+            });
+        }
 
-    return {
-        save: save,
-        remove: remove,
-        removeAll: removeAll
-    }
-});
+        return {
+            save: save,
+            remove: remove,
+            removeAll: removeAll
+        }
+    });

+ 4 - 4
www/js/factories/sales/opportunity.sync.factory.js

@@ -192,16 +192,16 @@ angular.module('odoo')
          */
         var sync = function (success, error) {
             syncNewData(function () { 
-                console.log('new data ok');
+                console.log('opportunities --> new data ok');
 
                 syncUpdatedData(function () {
-                    console.log('updated data ok');
+                    console.log('opportunities --> updated data ok');
 
                     syncDeletedData(function () {
-                        console.log('deleted data ok');
+                        console.log('opportunities --> deleted data ok');
 
                         downloadSyncData(function (data) { 
-                            console.log('download data ok');
+                            console.log('opportunities --> download data ok');
 
                             success(data);
                         }, function (syncErr) {

File diff suppressed because it is too large
+ 3 - 2
www/templates/sales/customers.html


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

@@ -10,7 +10,7 @@
         <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-list type="card">
+        <ion-list type="card" ng-show="!leads || leads.length != 0">
           <ion-item assertive on-hold="openOptions($index)" ng-repeat="l in leads">
               <h2><strong>{{ l.name }}</strong></h2>
               <p><strong>Contacto:</strong>{{ l.contact_name }}</p>

+ 11 - 8
www/templates/sales/opportunities.html

@@ -11,14 +11,17 @@
 
         <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">
-                <ion-list type="card">
-                  <ion-item ng-class="{'holded': selected == $index }" on-hold="openOptions($index)" ng-repeat="o in opportunities">
-                      <h2><strong>{{ o.name | uppercase }}</strong></h2>
-                      <p><strong>Contacto:</strong> {{ o.contact_name }}</p>
-                      <p><strong>Teléfono:</strong> {{ o.phone }}</p>
-                      <p><strong>Móvil:</strong> {{ o.mobile }}</p>
-                      <ion-option-button class="button-positive" ng-click="share(item)">Share</ion-option-button>
-                  </ion-item>
+                <ion-scroll style="height: 500px;">
+                    <ion-list type="card" style="height: 2000px;" ng-show="!opportunities || opportunities.length != 0">
+                        <ion-item ng-class="{'holded': selected == $index }" on-hold="openOptions($index)" ng-repeat="o in opportunities">
+                            <h2><strong>{{ o.name | uppercase }}</strong></h2>
+                            <p><strong>Contacto:</strong> {{ o.contact_name }}</p>
+                            <p><strong>Teléfono:</strong> {{ o.phone }}</p>
+                            <p><strong>Móvil:</strong> {{ o.mobile }}</p>
+                            <ion-option-button class="button-positive" ng-click="share(item)">Share</ion-option-button>
+                        </ion-item>
+                    </ion-list>
+                </ion-scroll>
             </ion-slide-page>
         </ion-slides>
     </ion-content>

Some files were not shown because too many files changed in this diff