Skip to content
Snippets Groups Projects
Commit 56ecc9c4 authored by wan's avatar wan
Browse files

[FIX] account: auto-balance opening entry


If the opening entry is balanced, the auto-balance line is unlinked.
However, before unlinking we test if it is balanced, which it is not. A
solution is removing the line from the move and it will be unlinked
automatically.

closes odoo/odoo#42930

Signed-off-by: default avataroco-odoo <oco-odoo@users.noreply.github.com>
parent 05429ca9
Branches
Tags
No related merge requests found
......@@ -390,7 +390,7 @@ class ResCompany(models.Model):
if float_is_zero(debit_diff + credit_diff, precision_rounding=currency.rounding):
if balancing_move_line:
# zero difference and existing line : delete the line
balancing_move_line.unlink()
self.account_opening_move_id.line_ids -= balancing_move_line
else:
if balancing_move_line:
# Non-zero difference and existing line : edit the line
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment