mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[IMP] assert that move is balanced, recompute amount total, and set reconciled to false to avoid having a null value instead
This commit is contained in:
committed by
Florian da Costa
parent
f794a514d2
commit
49008e7d9c
@@ -249,6 +249,7 @@ class AccountJournal(models.Model):
|
|||||||
'balance_cash_basic': values['debit'] - values['credit'],
|
'balance_cash_basic': values['debit'] - values['credit'],
|
||||||
'ref': move.ref,
|
'ref': move.ref,
|
||||||
'user_type_id': account.user_type_id.id,
|
'user_type_id': account.user_type_id.id,
|
||||||
|
'reconciled': False,
|
||||||
})
|
})
|
||||||
values = move_line_obj._add_missing_default_values(values)
|
values = move_line_obj._add_missing_default_values(values)
|
||||||
return values
|
return values
|
||||||
@@ -323,6 +324,11 @@ class AccountJournal(models.Model):
|
|||||||
self._write_extra_move_lines(parser, move)
|
self._write_extra_move_lines(parser, move)
|
||||||
if self.create_counterpart:
|
if self.create_counterpart:
|
||||||
self._create_counterpart(parser, move)
|
self._create_counterpart(parser, move)
|
||||||
|
# Check if move is balanced
|
||||||
|
move.assert_balanced()
|
||||||
|
# Computed total amount of the move
|
||||||
|
move._amount_compute()
|
||||||
|
# Attach data to the move
|
||||||
attachment_data = {
|
attachment_data = {
|
||||||
'name': 'statement file',
|
'name': 'statement file',
|
||||||
'datas': file_stream,
|
'datas': file_stream,
|
||||||
|
|||||||
Reference in New Issue
Block a user