diff --git a/bindings/python/example_scripts/rest-api/gnucash_rest.py b/bindings/python/example_scripts/rest-api/gnucash_rest.py index 274a2fa3c6..d9343b35a1 100644 --- a/bindings/python/example_scripts/rest-api/gnucash_rest.py +++ b/bindings/python/example_scripts/rest-api/gnucash_rest.py @@ -909,7 +909,7 @@ def getTransactions(book, account_guid, date_posted_from, date_posted_to): for transaction in query.run(): transactions.append(gnucash_simple.transactionToDict( - gnucash.gnucash_business.Transaction(instance=transaction))) + gnucash.gnucash_business.Transaction(instance=transaction), ['splits'])) query.destroy() @@ -1775,7 +1775,7 @@ def addTransaction(book, num, description, date_posted, currency_mnumonic, split transaction.SetDescription(description) transaction.SetNum(num) - transaction.SetDatePostedTS(date_posted) + transaction.SetDatePostedSecs(date_posted) transaction.CommitEdit() @@ -1855,7 +1855,7 @@ def editTransaction(book, transaction_guid, num, description, date_posted, transaction.SetDescription(description) transaction.SetNum(num) - transaction.SetDatePostedTS(date_posted) + transaction.SetDatePostedSecs(date_posted) transaction.CommitEdit() diff --git a/bindings/python/example_scripts/rest-api/gnucash_simple.py b/bindings/python/example_scripts/rest-api/gnucash_simple.py index 2aa234f953..3672079201 100644 --- a/bindings/python/example_scripts/rest-api/gnucash_simple.py +++ b/bindings/python/example_scripts/rest-api/gnucash_simple.py @@ -119,8 +119,9 @@ def transactionToDict(transaction, entities): simple_transaction['date_due'] = transaction.RetDateDue().strftime( '%Y-%m-%d') simple_transaction['void_status'] = transaction.GetVoidStatus() - simple_transaction['void_time'] = transaction.GetVoidTime().strftime( - '%Y-%m-%d') + void_time = transaction.GetVoidTime() + simple_transaction['void_time'] = ( + void_time.strftime('%Y-%m-%d') if void_time is not None else None) simple_transaction['description'] = transaction.GetDescription()