Skip to content
Permalink
Browse files

[FIX] account: allow to do action on move before delete when reconcil…

…e from suspense
  • Loading branch information...
william-andre committed Apr 24, 2019
1 parent dfebe2f commit accaa1ef4cb213d6bbb39c170ff1b25287f21688
Showing with 6 additions and 2 deletions.
  1. +6 −2 addons/account/models/account_bank_statement.py
@@ -280,7 +280,7 @@ def button_open(self):
st_number = SequenceObj.with_context(**context).next_by_code('account.bank.statement')
statement.name = st_number
statement.state = 'open'

@api.multi
def action_bank_reconcile_bank_statements(self):
self.ensure_one()
@@ -636,9 +636,13 @@ def process_reconciliation(self, counterpart_aml_dicts=None, payment_aml_rec=Non
# Create the move
self.sequence = self.statement_id.line_ids.ids.index(self.id) + 1
move_vals = self._prepare_reconciliation_move(self.statement_id.name)
move = self.env['account.move'].create(move_vals)
if edition_mode:
try:
move.manage_before_delete(self.journal_entry_ids.mapped('move_id'))
except AttributeError: # documents_account not installed
pass
self.button_cancel_reconciliation()
move = self.env['account.move'].create(move_vals)
counterpart_moves = (counterpart_moves | move)

# Create The payment

0 comments on commit accaa1e

Please sign in to comment.
You can’t perform that action at this time.