[FIX] account: cr.execute() without flush() in reconciliation
closes odoo/odoo#109013 X-original-commit: 77e80ff62c0f7584857fbdb96aae5caea62aa504 Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
@@ -3044,6 +3044,10 @@ class AccountMove(models.Model):
|
||||
if not reconciled_lines:
|
||||
return {}
|
||||
|
||||
self.env['account.partial.reconcile'].flush_model([
|
||||
'credit_amount_currency', 'credit_move_id', 'debit_amount_currency',
|
||||
'debit_move_id', 'exchange_move_id',
|
||||
])
|
||||
query = '''
|
||||
SELECT
|
||||
part.id,
|
||||
@@ -3080,6 +3084,7 @@ class AccountMove(models.Model):
|
||||
exchange_move_ids.add(values['exchange_move_id'])
|
||||
|
||||
if exchange_move_ids:
|
||||
self.env['account.move.line'].flush_model(['move_id'])
|
||||
query = '''
|
||||
SELECT
|
||||
part.id,
|
||||
|
||||
@@ -1901,6 +1901,7 @@ class TestAccountMoveReconcile(AccountTestInvoicingCommon):
|
||||
# 3th reconciliation inv1 + pay1
|
||||
self.assert_invoice_outstanding_reconciled_widget(inv2, {
|
||||
refund1.id: 28.46,
|
||||
res['partials'].exchange_move_id.id: 6.34,
|
||||
})
|
||||
self.assert_invoice_outstanding_to_reconcile_widget(inv2, {
|
||||
pay1.move_id.id: 1907.17,
|
||||
|
||||
Reference in New Issue
Block a user