0

I am trying to retrieve data from the database using jsonRpc using odoo api but i got the erro like "HTTP/1.1 GET /projects" - 404 Not Found"

here is my code snnipet

python script which is used to manipulate the data

class projects:
    def GET(self):

        print("get")
        data=[]
        web.header('Access-Control-Allow-Origin',      '*')
        web.header('Access-Control-Allow-Credentials', 'true')
        web.header('Content-Type', 'application/json')

        auth = web.input()
        print(auth)
        odoo = odoorpc.ODOO('field.holisticbs.com',port=8069)
        odoo.login('field.holisticbs.com','info@holisticbs.com','admin')

        Project = odoo.execute('project.task','search_read',[[['company_id', '=', int(auth.company)],['user_id','=',int(auth.user)]]])
        return json.dumps(Project)

controller.js

controller('projectCtrl',function ($scope,API,$localStorage,localStorageService) {
  // body...
  console.log("Project ctrl");
  API.showLoad();

  var resource = "projects";
  API.getData(resource, localStorageService.get('user')).then(function(data) {
    // console.log("quotation"+data);
    console.log(data);
    $scope.projects = data;

  }).catch(function(data, status) {
    alert("error in request");
    //console.error('GET Orders error', response.status, response.data);
  }).finally(function() {
    console.log("finally finished projects");
    API.hideLoad();
  });

})

service.js

function getDetails(resource,data) {
        console.log(resource);
        console.log(data);
        var request = $http({
            method: "get",
            url: backend+resource,
            params: {instance: data.inst, user:data.user, company:data.company}
        });
        return(request.then( handleSuccess, handleError ));
    }

project.html(view page which display blank)

<ion-view view-title="Projects">
  <ion-content>
    <ion-list>
      <div class="card" ng-contoller="projectCtrl">
       <a class="button button-icon" href="#/app/newProject">
        <button class="button button-positive">Create Project</button> </a>
      <h2> project </h2>
        <ion-item ng-repeat="proj in projects" href="#/app/projects/{{proj.id}}">
          <h2 class="padding">{{proj.id}}. {{proj.name}}</h2>

              <div class="row" ng-if="proj.partner_id[1]">
                <span class="col col-25">Customer:</span>
                <span class="col">{{proj.partner_id[1]}}</span>
              </div>

              <div class="row" ng-if="quot.date_order">
                <span class="col col-25">Date:</span>
                <span class="col">{{proj.date_order}}</span>
              </div>

              <div class="row" ng-if="quot.state">
                <span class="col col-25">Status:</span>
                <span class="col">{{proj.state}}</span>
              </div>

        </ion-item> 
      </div>
    </ion-list>
  </ion-content>
</ion-view>
Cœur
  • 37,241
  • 25
  • 195
  • 267
  • What troubleshooting have you done to locate the problem? What do you see in the network tab of the dev console? Does the request have the correct headers and url for the "project" resource? – Yogi Apr 16 '16 at 08:09
  • 1
    i have my python script on remote server and by using ssh login throgh terminal i access the server and execute that script for debugging ! i can see the url perfectly @Roberto – user3153295 Apr 16 '16 at 10:54

1 Answers1

0

just a silly mistake annoying me. not specified in url for routing

urls = ( '/products', 'products', '/projects', 'projects', '/product/(.+)', 'product' )