Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Billing Account is not available for fetch #93

Closed
bazarnov opened this issue Sep 9, 2022 · 7 comments
Closed

Billing Account is not available for fetch #93

bazarnov opened this issue Sep 9, 2022 · 7 comments

Comments

@bazarnov
Copy link

bazarnov commented Sep 9, 2022

Hello, faced with next issue:

search_cls = self.get_complex_type(search_cls_name)\n  File \"/Users/baz/gl/airbyte/airbyte-integrations/connectors/source
netsuite/.venv/lib/python3.9/site-packages/netsuitesdk/internal/client.py\", line 140, in get_complex_type\n    return
**self._complex_types[type_name]\nKeyError: 'BillingAccountSearch'\n", "failure_type": "system_error"}}}**

A little research shows that there is no object inside of self._complex_types called BillingAccountSearch only BillingAccount is available:

"ConsolidatedExchangeRateSearchBasic": <zeep.xsd.dynamic_types.ConsolidatedExchangeRateSearchBasic object at 0x7fba288b44c0>,
"ItemCostEstimateType": <zeep.xsd.dynamic_types.ItemCostEstimateType object at 0x7fba2785c250>,
"BillingAccount": <zeep.xsd.dynamic_types.BillingAccount object at 0x7fba27d7b190>,
"CustomerAddressbook": <zeep.xsd.dynamic_types.CustomerAddressbook object at 0x7fba27cbd880>,
"CustomerAddressbookList": <zeep.xsd.dynamic_types.CustomerAddressbookList object at 0x7fba27cbddc0>,

Is this something on my side, or generally issued as missing?

@bazarnov
Copy link
Author

bazarnov commented Sep 9, 2022

@RodrigoATorres tagging you as the latest person who committed here. Would appreciate any advice or explanation if such. Thanks!

@bazarnov
Copy link
Author

@gustahrodrigues

@bazarnov
Copy link
Author

@Sravanksk

@Sravanksk
Copy link
Contributor

Sravanksk commented Sep 12, 2022

@bazarnov by looking at this error, I'm assuming that your basic search on BillingAccounts is failing.
A little research shows that there is no object inside of self._complex_types called BillingAccountSearch only BillingAccount is available:

Also get_all of BillingAccounts is failing with a search error. The reason behind this is, for get_all we make paginated calls to NetSuite API with paginated search. Since the BillingAccountSearch type is not defined in complex types, it is failing with an error

To make the search and get_all work on BillingAccount, You'll have to add 'BillingAccountSearchBasic' in ns5 COMPLEX_TYPE and BillingAccountSearch in ns13 COMPLEX_TYPE in netsuite_types.py to make things work as expected.

Once BillingAccountSearchBasic and BillingAccountSearch is added in NetSuite complex types, your search and fetch of BillingAccounts will work as expected

search_object = netsuite_connection.billing_accounts.search(attribute='id', value='1', operator='is'))
print(search_object)

Thanks

@bazarnov
Copy link
Author

I'll try, will keep you posted.

@Sravanksk
Copy link
Contributor

@bazarnov I have fixed the issue for now. Please check this commit for more info.
Please test this by installing the latest version -> netsuitesdk==2.14.0

Thanks

@bazarnov
Copy link
Author

bazarnov commented Sep 12, 2022

@Sravanksk

Works perfectly, thank you! Could you also take a look at this issue, I need a complete picture on search as well: #71 (comment)

The attention to this is much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants