From 634015d8528b16f387bf15cf0272949d66eb97cf Mon Sep 17 00:00:00 2001 From: Ashwin Thanaraj <37061471+ashwin1111@users.noreply.github.com> Date: Mon, 30 Jan 2023 13:22:35 +0530 Subject: [PATCH] Fix Journal Entry class (#102) --- netsuitesdk/api/journal_entries.py | 9 +++------ setup.py | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/netsuitesdk/api/journal_entries.py b/netsuitesdk/api/journal_entries.py index 18868ba..7ad59f9 100644 --- a/netsuitesdk/api/journal_entries.py +++ b/netsuitesdk/api/journal_entries.py @@ -29,9 +29,6 @@ def __init__(self, ns_client): ApiBase.__init__(self, ns_client=ns_client, type_name=self.TYPE_NAME) # Uppercase the first letter of the type name to get the class name self.class_name = self.type_name[:1].upper() + self.type_name[1:] - self.class_ = getattr(ns_client, self.class_name) - self.line_class_ = getattr(ns_client, self.class_name + 'Line') - self.line_list_class_ = getattr(ns_client, self.class_name + 'LineList') def get_all_generator(self): record_type_search_field = self.ns_client.SearchStringField(searchValue=self.class_name, operator='contains') @@ -44,7 +41,7 @@ def get_all_generator(self): def post(self, data) -> OrderedDict: assert data['externalId'], 'missing external id' - je = self.class_(externalId=data['externalId']) + je = self.ns_client.JournalEntry(externalId=data['externalId']) line_list = [] for eod in data['lineList']: if 'customFieldList' in eod and eod['customFieldList']: @@ -69,10 +66,10 @@ def post(self, data) -> OrderedDict: ) ) eod['customFieldList'] = self.ns_client.CustomFieldList(custom_fields) - jee = self.line_class_(**eod) + jee = self.ns_client.JournalEntryLine(**eod) line_list.append(jee) - je['lineList'] = self.line_list_class_(line=line_list) + je['lineList'] = self.ns_client.JournalEntryLineList(line=line_list) self.build_simple_fields(self.SIMPLE_FIELDS, data, je) self.build_record_ref_fields(self.RECORD_REF_FIELDS, data, je) diff --git a/setup.py b/setup.py index 3b77766..bdab51d 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name='netsuitesdk', - version='2.16.1', + version='2.16.2', author='Siva Narayanan', author_email='siva@fyle.in', description='Python SDK for accessing the NetSuite SOAP webservice',