Skip to content

Commit

Permalink
[FIX] account: aml linked to statement
Browse files Browse the repository at this point in the history
When fetching the journal items linked to a bank statement, the
counterpart items are not retrievd since they are not directly linked to
the bank statement. It makes the entries look unbalanced.

Closes odoo#13673
opw-690231
  • Loading branch information
nim-odoo committed Oct 20, 2016
1 parent afc2497 commit d30dc96
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addons/account/models/account_bank_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,16 @@ def button_confirm_bank(self):
def button_journal_entries(self):
context = dict(self._context or {})
context['journal_id'] = self.journal_id.id
aml = self.env['account.move.line'].search([('statement_id', 'in', self.ids)])
aml |= aml.mapped('move_id').mapped('line_ids')
return {
'name': _('Journal Items'),
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'account.move.line',
'view_id': False,
'type': 'ir.actions.act_window',
'domain': [('statement_id', 'in', self.ids)],
'domain': [('id', 'in', aml.ids)],
'context': context,
}

Expand Down

0 comments on commit d30dc96

Please sign in to comment.