123456789101112131415161718192021222324252627282930313233343536373839404142 |
- angular.module('odoo')
- .controller('ConfigurationController', function (
- $scope,
- $state,
- $ionicLoading,
- $ionicPopup,
- $localStorage,
- odooFactory,
- databaseFactory
- ) {
- $scope.loading = false;
- $scope.configuration = $localStorage.$default({
- host: '192.168.2.105',
- port: 8069,
- database: 'odoo',
- username: 'admin',
- password: 'admin',
- id: null
- });
- // Auth app
- $scope.auth = function () {
- $scope.loading = true;
- odooFactory.auth($scope.configuration, function (id) {
- $scope.configuration.id = id;
- databaseFactory.initTables(function (result) {
- $scope.loading = false;
- $state.go('app.main');
- }, function (err) {
- $scope.loading = false;
- console.log(err);
- });
- }, function (err) {
- $scope.loading = false;
- console.log(err);
- });
- }
- });
|