Skip to content

Commit

Permalink
call both tax items and tax groups generator separately (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
NileshPant1999 authored Feb 8, 2024
1 parent c16055d commit b078a96
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/netsuite/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,12 +876,11 @@ def sync_tax_items(self):
"""
Sync Tax Details
"""
tax_items_generator = self.connection.tax_items.get_all_generator()
tax_groups_generator = self.connection.tax_groups.get_all_generator()

tax_item_attributes = []
tax_group_attributes = []

tax_items_generator = self.connection.tax_items.get_all_generator()
for tax_items in tax_items_generator:
for tax_item in tax_items:
if not tax_item['isInactive'] and tax_item['itemId'] and tax_item['taxType'] and tax_item['rate']:
Expand All @@ -903,6 +902,8 @@ def sync_tax_items(self):
DestinationAttribute.bulk_create_or_update_destination_attributes(
tax_item_attributes, 'TAX_ITEM', self.workspace_id, True)


tax_groups_generator = self.connection.tax_groups.get_all_generator()
for tax_groups in tax_groups_generator:
for tax_group in tax_groups:
if not tax_group['isInactive'] and tax_group['itemId']:
Expand Down

0 comments on commit b078a96

Please sign in to comment.