client
|
Last change
on this file since 8132e8c was
8132e8c,
checked in by Alex Dehnert <adehnert@…>, 16 years ago
|
|
The executable bit is shiny
|
-
Property mode set to
100755
|
|
File size:
863 bytes
|
| Line | |
|---|
| 1 | import sys |
|---|
| 2 | import os |
|---|
| 3 | |
|---|
| 4 | if __name__ == '__main__': |
|---|
| 5 | cur_file = os.path.abspath(__file__) |
|---|
| 6 | django_dir = os.path.abspath(os.path.join(os.path.dirname(cur_file), '..')) |
|---|
| 7 | sys.path.append(django_dir) |
|---|
| 8 | os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' |
|---|
| 9 | |
|---|
| 10 | import finance_core.models |
|---|
| 11 | import vouchers.models |
|---|
| 12 | |
|---|
| 13 | import util.add_gl_accounts |
|---|
| 14 | import finance_core.util |
|---|
| 15 | |
|---|
| 16 | base_structure = ( |
|---|
| 17 | ('Assets', None, ), |
|---|
| 18 | ('Expenses', None, ), |
|---|
| 19 | ('Income', None, ), |
|---|
| 20 | ) |
|---|
| 21 | |
|---|
| 22 | if __name__ == '__main__': |
|---|
| 23 | if len(finance_core.models.BudgetArea.objects.filter(depth=1)) == 0: |
|---|
| 24 | base = finance_core.models.BudgetArea.add_root(name='Accounts', always=True, use_owner=True, ) |
|---|
| 25 | else: |
|---|
| 26 | base = finance_core.models.BudgetArea.get_by_path(['Accounts',]) |
|---|
| 27 | finance_core.util.mass_add_accounts(base, base_structure, sys.stdout, ) |
|---|
| 28 | util.add_gl_accounts.add_gl_accounts() |
|---|
Note: See
TracBrowser
for help on using the repository browser.