-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for prepending code to COA (#655)
* add support for prepending code to COA * fix breaking test_cases * add test cases * change docker-compose to docker compose * add config api, add prepend for refresh dimension method * update requirements, submodule * add seperator for the account imported with code * fix workspace_id error
- Loading branch information
1 parent
94f4a67
commit e07a88b
Showing
21 changed files
with
1,553 additions
and
1,123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,30 @@ | ||
from rest_framework import generics | ||
|
||
from rest_framework import generics, status | ||
from rest_framework.response import Response | ||
from apps.workspaces.apis.import_settings.serializers import ImportSettingsSerializer | ||
from apps.workspaces.models import Workspace | ||
from fyle_integrations_imports.models import ImportLog | ||
|
||
|
||
class ImportSettingsView(generics.RetrieveUpdateAPIView): | ||
serializer_class = ImportSettingsSerializer | ||
|
||
def get_object(self): | ||
return Workspace.objects.filter(id=self.kwargs['workspace_id']).first() | ||
|
||
|
||
class ImportCodeFieldView(generics.GenericAPIView): | ||
""" | ||
Import Code Field View | ||
""" | ||
def get(self, request, *args, **kwargs): | ||
workspace_id = kwargs['workspace_id'] | ||
category_import_log = ImportLog.objects.filter(workspace_id=workspace_id, attribute_type='CATEGORY').first() | ||
|
||
response_data = { | ||
'ACCOUNT': False if category_import_log else True, | ||
} | ||
|
||
return Response( | ||
data=response_data, | ||
status=status.HTTP_200_OK | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
apps/workspaces/migrations/0046_workspacegeneralsettings_import_code_fields.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 3.2.14 on 2024-08-01 10:27 | ||
|
||
import django.contrib.postgres.fields | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('workspaces', '0045_alter_workspacegeneralsettings_is_tax_override_enabled'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='workspacegeneralsettings', | ||
name='import_code_fields', | ||
field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(choices=[('ACCOUNT', 'ACCOUNT')], max_length=255), blank=True, default=list, help_text='Code Preference List', size=None), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule fyle_integrations_imports
updated
6 files
+24 −7 | modules/base.py | |
+76 −3 | modules/categories.py | |
+1 −1 | modules/cost_centers.py | |
+1 −1 | modules/projects.py | |
+1 −0 | queues.py | |
+3 −1 | tasks.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.