#NEWLINE# def create_default_accounts( ) : #NEWLINE# #INDENT# 'Create the default structure' #NEWLINE# from oscar_accounts import names #NEWLINE# AccountType = get_model ( 'oscar_accounts' , 'AccountType' ) #NEWLINE# assets = AccountType . add_root ( name = names . ASSETS ) #NEWLINE# sales = assets . add_child ( name = names . SALES ) #NEWLINE# sales . accounts . create ( name = names . REDEMPTIONS ) #NEWLINE# sales . accounts . create ( name = names . LAPSED ) #NEWLINE# cash = assets . add_child ( name = names . CASH ) #NEWLINE# cash . accounts . create ( name = names . BANK , credit_limit = None ) #NEWLINE# unpaid = assets . add_child ( name = names . UNPAID_ACCOUNT_TYPE ) #NEWLINE# for name in names . UNPAID_ACCOUNTS : #NEWLINE# #INDENT# unpaid . accounts . create ( name = name , credit_limit = None ) #NEWLINE# #UNINDENT# liabilities = AccountType . add_root ( name = names . LIABILITIES ) #NEWLINE# income = liabilities . add_child ( name = names . DEFERRED_INCOME ) #NEWLINE# for ( i , name ) in enumerate ( names . DEFERRED_INCOME_ACCOUNT_TYPES ) : #NEWLINE# #INDENT# income . add_child ( name = name )