|
@@ -13,6 +13,10 @@ angular.module('odoo')
|
|
|
$scope.loading = false;
|
|
|
$scope.leads = [];
|
|
|
$scope.lead = {};
|
|
|
+ $scope.conversion = {
|
|
|
+ action: 'convert',
|
|
|
+ customer: 'create'
|
|
|
+ };
|
|
|
$scope.search = null;
|
|
|
|
|
|
$ionicModal.fromTemplateUrl('templates/sales/lead.html', {
|
|
@@ -22,6 +26,13 @@ angular.module('odoo')
|
|
|
$scope.leadModal = modal;
|
|
|
});
|
|
|
|
|
|
+ $ionicModal.fromTemplateUrl('templates/sales/leadToOpportunity.html', {
|
|
|
+ scope: $scope,
|
|
|
+ animation: 'slide-in-up'
|
|
|
+ }).then(function(modal) {
|
|
|
+ $scope.leadToOpportunityModal = modal;
|
|
|
+ });
|
|
|
+
|
|
|
$scope.$on('$ionicView.enter', function () {
|
|
|
$scope.fill();
|
|
|
});
|
|
@@ -57,7 +68,7 @@ angular.module('odoo')
|
|
|
}, function (getLeadsErr) {
|
|
|
$scope.$broadcast('scroll.refreshComplete');
|
|
|
$scope.loading = false;
|
|
|
-
|
|
|
+
|
|
|
$ionicPopup.alert({ title: 'No se pudo obtener las iniciativas' });
|
|
|
});
|
|
|
});
|
|
@@ -122,6 +133,11 @@ angular.module('odoo')
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ $scope.convertToOpportunity = function () {
|
|
|
+ console.log($scope.conversion);
|
|
|
+ $scope.leadToOpportunityModal.hide();
|
|
|
+ }
|
|
|
+
|
|
|
$scope.toggleSearch = function () {
|
|
|
$scope.search = $ionicFilterBar.show({
|
|
|
items: $scope.leads,
|
|
@@ -161,7 +177,7 @@ angular.module('odoo')
|
|
|
$scope.show();
|
|
|
break;
|
|
|
case 1:
|
|
|
- console.log('1');
|
|
|
+ $scope.leadToOpportunityModal.show();
|
|
|
break;
|
|
|
default:
|
|
|
$scope.show();
|