From b078a962a1a7514ea75c0a0692a86fcf92d0601e Mon Sep 17 00:00:00 2001 From: Nilesh Pant <58652823+NileshPant1999@users.noreply.github.com> Date: Thu, 8 Feb 2024 12:13:20 +0530 Subject: [PATCH] call both tax items and tax groups generator separately (#484) --- apps/netsuite/connector.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/netsuite/connector.py b/apps/netsuite/connector.py index 6c397be0..1f69fc01 100644 --- a/apps/netsuite/connector.py +++ b/apps/netsuite/connector.py @@ -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']: @@ -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']: