diff --git a/apps/business_central/helpers.py b/apps/business_central/helpers.py index 57a0ee0..077f2b7 100644 --- a/apps/business_central/helpers.py +++ b/apps/business_central/helpers.py @@ -48,7 +48,7 @@ def sync_dimensions(business_central_credential: BusinessCentralCredentials, wor business_central_connection = import_string('apps.business_central.utils.BusinessCentralConnector')(business_central_credential, workspace_id) # List of dimensions to sync - dimensions = ['accounts', 'vendors', 'employees', 'locations', 'companies'] + dimensions = ['companies', 'accounts', 'vendors', 'employees', 'locations'] for dimension in dimensions: try: diff --git a/apps/business_central/serializers.py b/apps/business_central/serializers.py index 45f1928..34d1d50 100644 --- a/apps/business_central/serializers.py +++ b/apps/business_central/serializers.py @@ -146,4 +146,4 @@ def get_company(self, workspace_id): business_central_credentials.refresh_token = None business_central_credentials.is_expired = True business_central_credentials.save() - return Response(data={'message': 'Invalid token or Business Central connection expired'}, status=status.HTTP_400_BAD_REQUEST) + return Response(data={'message': 'Invalid token or Business Central connection expired'}, status=status.HTTP_400_BAD_REQUEST) diff --git a/apps/business_central/views.py b/apps/business_central/views.py index 0dbfcc3..53b8ef5 100644 --- a/apps/business_central/views.py +++ b/apps/business_central/views.py @@ -44,4 +44,4 @@ class ConnectionView(generics.RetrieveAPIView): serializer_class = Connectionserializer def get(self, request, *args, **kwargs): - return Connectionserializer.get_company(kwargs['workspace_id']) + return Connectionserializer().get_company(kwargs['workspace_id']) diff --git a/requirements.txt b/requirements.txt index 5a05c2a..7326e99 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,7 +28,7 @@ gunicorn==20.1.0 fyle==0.36.0 # Business central sdk -ms-dynamics-business-central-sdk==1.4.1 +ms-dynamics-business-central-sdk==1.4.2 # Reusable Fyle Packages fyle-rest-auth==1.6.0