[FIX] account: initial balance
- Create manually an account move - Add a line with a credit != 0 - Click on "Add a line" => crash `line_ids` does not contain the credit since it was not filled in. opw-782980
This commit is contained in:
committed by
Nicolas Martinelli
parent
7a951d7085
commit
54c2c08747
@@ -471,7 +471,7 @@ class AccountMoveLine(models.Model):
|
||||
balance = 0
|
||||
for line in self._context['line_ids']:
|
||||
if line[2]:
|
||||
balance += line[2]['debit'] - line[2]['credit']
|
||||
balance += line[2].get('debit', 0) - line[2].get('credit', 0)
|
||||
if balance < 0:
|
||||
rec.update({'debit': -balance})
|
||||
if balance > 0:
|
||||
|
||||
Reference in New Issue
Block a user