self.init_balance = data['form']['initial_balance']
self.display_account = data['form']['display_account']
self.target_move = data['form'].get('target_move', 'all')
+ ctx = self.context.copy()
+ ctx['fiscalyear'] = data['form']['fiscalyear_id']
+ if data['form']['filter'] == 'filter_period':
+ ctx['periods'] = data['form']['periods']
+ elif data['form']['filter'] == 'filter_date':
+ ctx['date_from'] = data['form']['date_from']
+ ctx['date_to'] = data['form']['date_to']
+ ctx['state'] = data['form']['target_move']
+ self.context.update(ctx)
if (data['model'] == 'ir.ui.menu'):
new_ids = [data['form']['chart_account_id']]
objects = self.pool.get('account.account').browse(self.cr, self.uid, new_ids)
def get_children_accounts(self, account):
res = []
ids_acc = self.pool.get('account.account')._get_children_and_consol(self.cr, self.uid, account.id)
- for child_account in self.pool.get('account.account').browse(self.cr, self.uid, ids_acc):
+ for child_account in self.pool.get('account.account').browse(self.cr, self.uid, ids_acc, context=self.context):
sql = """
SELECT count(id)
FROM account_move_line AS l
return res
def _sum_debit_account(self, account):
+ if account.type == 'view':
+ return account.debit
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted','']
return sum_debit
def _sum_credit_account(self, account):
+ if account.type == 'view':
+ return account.credit
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted','']
return sum_credit
def _sum_balance_account(self, account):
+ if account.type == 'view':
+ return account.balance
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted','']
<td>
<blockTable colWidths="245.0,92.5,66.5,64.5,71.5" style="Table5">
<tr>
- <td><para style="Standard">[[ o.code or '']] [[ o.name or '']]</para></td>
+ <td><para style="Standard"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code or '']] [[ o.name or '']]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_debit_account(o)) ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o)) ]] </u></para></td>
<td>
<blockTable colWidths="230.00,74.0,55.5,60.5,60.5,65.5" style="Table5">
<tr>
- <td><para style="Standard">[[ o.code or '' ]] [[ o.name or '' ]]</para></td>
+ <td><para style="Standard"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code or '' ]] [[ o.name or '' ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_debit_account(o)) ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o)) ]]</u></para></td>
<td>
<blockTable colWidths="404.0,335.0,75.0,75.0,75.0,79.00" style="Table5">
<tr>
- <td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
+ <td><para style="Standard"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_debit_account(o)) ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o)) ]]</u></para></td>
<td>
<blockTable colWidths="405.0,435.0,69.0,72.0,64.0" style="Table5">
<tr>
- <td><para style="Standard">[[ o.code ]] [[ o.name ]]</para></td>
+ <td><para style="Standard"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para></td>
<td><para style="Standard"></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_debit_account(o)) ]]</u></para></td>
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o)) ]]</u></para></td>