From f2bd1b4aa10eb12cfac8eacbd028ca5d28449bf8 Mon Sep 17 00:00:00 2001 From: ruuushhh Date: Tue, 14 Nov 2023 15:17:05 +0530 Subject: [PATCH 1/2] Advanced settings sync payments field added --- apps/workspaces/models.py | 3 ++- tests/test_workspaces/test_views.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/workspaces/models.py b/apps/workspaces/models.py index 653b9bb1..ca33b5c7 100644 --- a/apps/workspaces/models.py +++ b/apps/workspaces/models.py @@ -216,8 +216,9 @@ class AdvancedSetting(BaseModel): interval_hours = IntegerNullField(help_text='Interval in hours') emails_selected = CustomJsonField(help_text='Emails Selected For Email Notification') emails_added = CustomJsonField(help_text='Emails Selected For Email Notification') - auto_create_vendor = BooleanFalseField(help_text='Auto create vendor') schedule = models.OneToOneField(Schedule, on_delete=models.PROTECT, null=True) + auto_create_vendor = BooleanFalseField(help_text='Auto create vendor') + sync_sage_300_to_fyle_payments = BooleanFalseField(help_text='Sync sage 300 to fyle payments') class Meta: db_table = 'advanced_settings' diff --git a/tests/test_workspaces/test_views.py b/tests/test_workspaces/test_views.py index a4c7eacb..f6b013be 100644 --- a/tests/test_workspaces/test_views.py +++ b/tests/test_workspaces/test_views.py @@ -250,7 +250,8 @@ def test_advanced_settings(api_client, test_connection): 'email': 'nilesh.p@fylehq.com' }, ]), - 'auto_create_vendor': True + 'auto_create_vendor': True, + 'sync_sage_300_to_fyle_payments': True } response = api_client.post(url, payload) @@ -275,6 +276,7 @@ def test_advanced_settings(api_client, test_connection): }, ] assert response.data['auto_create_vendor'] == True + assert response.data['sync_sage_300_to_fyle_payments'] == True response = api_client.get(url) From f02031bb702c7ba903867f8b756c33b0f5675bf2 Mon Sep 17 00:00:00 2001 From: ruuushhh Date: Tue, 14 Nov 2023 15:17:19 +0530 Subject: [PATCH 2/2] Advanced settings sync payments field added --- ...dsetting_sync_sage_300_to_fyle_payments.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 apps/workspaces/migrations/0004_advancedsetting_sync_sage_300_to_fyle_payments.py diff --git a/apps/workspaces/migrations/0004_advancedsetting_sync_sage_300_to_fyle_payments.py b/apps/workspaces/migrations/0004_advancedsetting_sync_sage_300_to_fyle_payments.py new file mode 100644 index 00000000..9497b141 --- /dev/null +++ b/apps/workspaces/migrations/0004_advancedsetting_sync_sage_300_to_fyle_payments.py @@ -0,0 +1,19 @@ +# Generated by Django 4.1.2 on 2023-11-14 09:46 + +from django.db import migrations +import sage_desktop_api.models.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('workspaces', '0003_remove_advancedsetting_schedule_id_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='advancedsetting', + name='sync_sage_300_to_fyle_payments', + field=sage_desktop_api.models.fields.BooleanFalseField(default=False, help_text='Sync sage 300 to fyle payments'), + ), + ]