RussellJuma / PySuiteCRM

MIT License
10 stars 4 forks source link

Targets throws error / likely issue with actual name Prospects #9

Open LittleDuke opened 1 year ago

LittleDuke commented 1 year ago

If I try calling:

result = suitecrm.Targets.get(last_name = 'adams', first_name = 'scott')

It blows up:

Traceback (most recent call last): File "./PySuiteCRM.py3", line 22, in <module> result = suitecrm.Targets.get(last_name = 'adams', first_name = 'scott') File "/www/portal/.local/lib/python3.6/site-packages/PySuiteCRM/SuiteCRM.py", line 227, in get return self.suitecrm.request(f'{self.suitecrm.baseurl}{url}', 'get')['data']

I get the same result if I test with my own native code (proper 400 error):

{ "errors": { "status": 400, "title": null, "detail": "Module Targets does not exist" } }

But if I make the same call with Prospects it works

Reported issue here: https://community.suitecrm.com/t/api-does-not-recognize-targets-but-will-recognize-prospects/88461

LittleDuke commented 1 year ago

If you patch up the file and change these two lines it works:

45 self.Prospect = Module(self, 'Prospect') 46 self.Prospects = Module(self, 'Prospects')