[FIX] account: reconciliation of payment with statement should not ta…

…ke lock date into account

If we have a payment in october and a statement in november and the lock date is 1st november, we can't reconcile both because we try to write statement_id on payment but there is the lockdate constraint. This is not correct and we should be able to reconcile both even after lock date as it is the case for other moves.
This commit is contained in:
Cedric Snauwaert
2017-11-30 16:50:54 +01:00
parent b780e4a0e4
commit be64ba6069
@@ -883,7 +883,7 @@ class AccountBankStatementLine(models.Model):
total = self.amount
for aml_rec in payment_aml_rec:
total -= aml_rec.debit - aml_rec.credit
aml_rec.write({'statement_line_id': self.id})
aml_rec.with_context(check_move_validity=False).write({'statement_line_id': self.id})
counterpart_moves = (counterpart_moves | aml_rec.move_id)
# Create move line(s). Either matching an existing journal entry (eg. invoice), in which