From ba563c16ea456a6decb342e55571e19b4d903f76 Mon Sep 17 00:00:00 2001 From: Hrishabh Tiwari Date: Thu, 5 Sep 2024 13:25:43 +0530 Subject: [PATCH 1/5] fix categories disable p0 bug --- apps/quickbooks_online/utils.py | 6 +++++- fyle_integrations_imports | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/quickbooks_online/utils.py b/apps/quickbooks_online/utils.py index ad50a1ce..c4cd203b 100644 --- a/apps/quickbooks_online/utils.py +++ b/apps/quickbooks_online/utils.py @@ -186,8 +186,11 @@ def sync_accounts(self): accounts_generator = self.connection.accounts.get_all_generator() category_sync_version = 'v2' general_settings = WorkspaceGeneralSettings.objects.filter(workspace_id=self.workspace_id).first() + is_category_import_to_fyle_enabled = False + if general_settings: category_sync_version = general_settings.category_sync_version + is_category_import_to_fyle_enabled = general_settings.import_categories for accounts in accounts_generator: account_attributes = {'account': [], 'credit_card_account': [], 'bank_account': [], 'accounts_payable': []} @@ -254,7 +257,8 @@ def sync_accounts(self): self.workspace_id, True, attribute_type.title().replace('_', ' '), - attribute_disable_callback_path=ATTRIBUTE_CALLBACK_PATH.get(attribute_type.upper()) + attribute_disable_callback_path=ATTRIBUTE_CALLBACK_PATH.get(attribute_type.upper()), + is_import_to_fyle_enabled=is_category_import_to_fyle_enabled ) last_synced_time = get_last_synced_time(self.workspace_id, 'CATEGORY') diff --git a/fyle_integrations_imports b/fyle_integrations_imports index 576dfd46..5311798a 160000 --- a/fyle_integrations_imports +++ b/fyle_integrations_imports @@ -1 +1 @@ -Subproject commit 576dfd4678d4b9c0d261543c8b64a926c4e3ff83 +Subproject commit 5311798a443493059a599187c97e1ea9e11c0ec1 From 0ab619de146745f4e7b7938463becff4ebd113d3 Mon Sep 17 00:00:00 2001 From: Hrishabh Tiwari Date: Thu, 5 Sep 2024 15:24:31 +0530 Subject: [PATCH 2/5] bump accounting_mapping version --- fyle_integrations_imports | 2 +- requirements.txt | 2 +- .../test_modules/test_categories.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fyle_integrations_imports b/fyle_integrations_imports index 5311798a..e1e3cb83 160000 --- a/fyle_integrations_imports +++ b/fyle_integrations_imports @@ -1 +1 @@ -Subproject commit 5311798a443493059a599187c97e1ea9e11c0ec1 +Subproject commit e1e3cb837b5e6e8aefccd90be50c981f41f2ddae diff --git a/requirements.txt b/requirements.txt index b7736c5d..79108bb2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,7 +21,7 @@ django-sendgrid-v5==1.2.0 enum34==1.1.10 future==0.18.2 fyle==0.37.0 -fyle-accounting-mappings==1.34.2 +fyle-accounting-mappings==1.34.3 fyle-integrations-platform-connector==1.38.4 fyle-rest-auth==1.7.2 flake8==4.0.1 diff --git a/tests/test_fyle_integrations_imports/test_modules/test_categories.py b/tests/test_fyle_integrations_imports/test_modules/test_categories.py index f59413b6..b306e2ba 100644 --- a/tests/test_fyle_integrations_imports/test_modules/test_categories.py +++ b/tests/test_fyle_integrations_imports/test_modules/test_categories.py @@ -504,7 +504,7 @@ def test_disable_categories( mock_platform = mocker.patch('fyle_integrations_imports.modules.categories.PlatformConnector') bulk_post_call = mocker.patch.object(mock_platform.return_value.categories, 'post_bulk') - disable_categories(workspace_id, categories_to_disable) + disable_categories(workspace_id, categories_to_disable, is_import_to_fyle_enabled=True) assert bulk_post_call.call_count == 1 @@ -517,7 +517,7 @@ def test_disable_categories( } } - disable_categories(workspace_id, categories_to_disable) + disable_categories(workspace_id, categories_to_disable, is_import_to_fyle_enabled=True) assert bulk_post_call.call_count == 1 # Test disable category with code in naming @@ -550,7 +550,7 @@ def test_disable_categories( 'id': 'source_id_123' }] - bulk_payload = disable_categories(workspace_id, categories_to_disable) + bulk_payload = disable_categories(workspace_id, categories_to_disable, is_import_to_fyle_enabled=True) assert bulk_payload == payload From 533e62377456a43720d9b910769db145d8aca8c1 Mon Sep 17 00:00:00 2001 From: Hrishabh Tiwari Date: Mon, 9 Sep 2024 11:50:05 +0530 Subject: [PATCH 3/5] update accounting mapping version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 79108bb2..f387b4c8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,7 +21,7 @@ django-sendgrid-v5==1.2.0 enum34==1.1.10 future==0.18.2 fyle==0.37.0 -fyle-accounting-mappings==1.34.3 +fyle-accounting-mappings==1.34.4 fyle-integrations-platform-connector==1.38.4 fyle-rest-auth==1.7.2 flake8==4.0.1 From eae86c28320334b386ee9890cee52a7f4b4d639c Mon Sep 17 00:00:00 2001 From: Hrishabh Tiwari Date: Tue, 17 Sep 2024 15:57:36 +0530 Subject: [PATCH 4/5] bump platform connector version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f387b4c8..77029bff 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,7 +22,7 @@ enum34==1.1.10 future==0.18.2 fyle==0.37.0 fyle-accounting-mappings==1.34.4 -fyle-integrations-platform-connector==1.38.4 +fyle-integrations-platform-connector==1.39.1 fyle-rest-auth==1.7.2 flake8==4.0.1 gevent==23.9.1 From e8fc76074be1f96a93e1d499bbfebda134e377e9 Mon Sep 17 00:00:00 2001 From: Hrishabh Tiwari Date: Tue, 17 Sep 2024 16:36:50 +0530 Subject: [PATCH 5/5] update submodule --- fyle_integrations_imports | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fyle_integrations_imports b/fyle_integrations_imports index e1e3cb83..e4c2de5f 160000 --- a/fyle_integrations_imports +++ b/fyle_integrations_imports @@ -1 +1 @@ -Subproject commit e1e3cb837b5e6e8aefccd90be50c981f41f2ddae +Subproject commit e4c2de5f794ad34382a1c53631443b7439c6d73f