2

I want to integrate Fedex with Odoo (formerly OpenERP) which is written in Python. Following is the code for tracking shipment integration.

def config_fedex(self, cr, uid, ids=False, context=None):
    self_brw = self.browse(cr, uid, ids[0])
    CONFIG_OBJ = FedexConfig(
                             key=self_brw.key,
                             password=self_brw.password,
                             account_number=self_brw.account_number,
                             meter_number=self_brw.meter_number,
                             use_test_server=self_brw.use_test_server
                             )
    return CONFIG_OBJ
import os
import sys
from openerp.osv import fields, osv
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import logging
from fedex.config import FedexConfig
from fedex.services.track_service import FedexTrackRequest
logging.basicConfig(level=logging.INFO) 

def track_shipment(self, cr, uid, ids=False, context=None):
    CONFIG_OBJ = self.config_fedex(cr, uid, ids)
    track = FedexTrackRequest(CONFIG_OBJ)
    track.TrackPackageIdentifier.Type = 'TRACKING_NUMBER_OR_DOORTAG'
    track.TrackPackageIdentifier.Value = '798114182456'
    track.send_request()
    print track.response
    print "== Results =="
    for match in track.response.TrackDetails:
        print "Tracking #:", match.TrackingNumber
        print "Status:", match.StatusDescription
    return True

but with this code every time I get following error:

'FedexFailure: Sorry, we are unable to process your tracking request. Please retry later, or contact Customer Service at 1.800.Go.FedEx(R) 800.463.3339. (Error code: 9075)'

I have checked '798114182456' directly on the Fedex website and it gives my current status.

What am I doing wrong? Are there other ways of doing this?

the
  • 21,007
  • 11
  • 68
  • 101

1 Answers1

1

This may help. Pretty much you need to get production keys and test on a real tracking number. I talked with FedEx web services over the phone today and they gave me the only test tracking number which is 123456789012. That has been working every time for me in my application. If I use a real tracking number with developer test keys it works maybe 1% of the time. Hope this helps.

Also make sure that when you do get production keys that you change the use_test_server to True in your config if you are using it that way. Otherwise you will get a auth error.

juzten
  • 144
  • 1
  • 7