Skip to content

Commit

Permalink
Fix allocation entry fetch (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwin1111 authored Aug 6, 2024
1 parent 19888e9 commit ccf6dde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions sageintacctsdk/apis/allocation_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ def get_all_generator(self, field: str = None, value: str = None, fields: list =

allocation_entries_fields = ['ALLOCATIONID', 'ALLOCATIONKEY', 'LOCATIONID', 'DEPARTMENTID', 'PROJECTID',
'CUSTOMERID', 'ITEMID', 'TASKID', 'COSTTYPEID', 'CLASSID']
user_defined_dimensions = []

fields = self.get_lookup()
if fields and 'Type' in fields and fields['Type'] and 'Relationships' in fields['Type'] and fields['Type']['Relationships'] and 'Relationship' in fields['Type']['Relationships']:
fields = fields['Type']['Relationships']['Relationship']
user_defined_dimensions = fields['Type']['Relationships']['Relationship']

for allocation_field in fields:
for allocation_field in user_defined_dimensions:
allocation_entries_fields.append(allocation_field['RELATEDBY'])

yield from super().get_all_generator(fields=allocation_entries_fields, field=field, value=value)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='sageintacctsdk',
version='1.22.2',
version='1.22.3',
author='Ashwin T',
author_email='[email protected]',
description='Python SDK for accessing Sage Intacct APIs',
Expand Down

0 comments on commit ccf6dde

Please sign in to comment.