Skip to content

Commit

Permalink
[FIX] account: impossible to re-post if post_at_bank_rec
Browse files Browse the repository at this point in the history
  • Loading branch information
fmdl committed Jun 9, 2020
1 parent 9872d2a commit 2cd6296
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions addons/account/models/account_move.py
Expand Up @@ -353,9 +353,8 @@ def post(self, invoice=False):

@api.multi
def action_post(self):
if self.mapped('line_ids.payment_id'):
if any(self.mapped('journal_id.post_at_bank_rec')):
raise UserError(_("A payment journal entry generated in a journal configured to post entries only when payments are reconciled with a bank statement cannot be manually posted. Those will be posted automatically after performing the bank reconciliation."))
if self.filtered(lambda x: x.journal_id.post_at_bank_rec).mapped('line_ids.payment_id').filtered(lambda x: x.state != 'reconciled'):
raise UserError(_("A payment journal entry generated in a journal configured to post entries only when payments are reconciled with a bank statement cannot be manually posted. Those will be posted automatically after performing the bank reconciliation."))
return self.post()

@api.multi
Expand Down

0 comments on commit 2cd6296

Please sign in to comment.