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