Skip to content

Commit

Permalink
[FIX] account: statement end balance compute new lines
Browse files Browse the repository at this point in the history
In a form view, the default state for a new statement line is 'draft'.
However, once it's saved is automatically posted.

Remove if merged: odoo/odoo#188675

TT51834
  • Loading branch information
chienandalu committed Nov 26, 2024
1 parent 204e473 commit 55d479a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions account_statement_base/models/account_bank_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,12 @@ def open_entries(self):
("statement_id", "=", self.id),
],
}

def _compute_balance_end(self):
# Consider new lines amount in the balance
# Remove if merged: https://github.com/odoo/odoo/pull/188675
res = super()._compute_balance_end()
for stmt in self:
lines = stmt.line_ids.filtered(lambda x: not x._origin)
stmt.balance_end = stmt.balance_end + sum(lines.mapped("amount"))
return res

0 comments on commit 55d479a

Please sign in to comment.