Skip to content
Snippets Groups Projects
Commit 1a2dc192 authored by Paul Morelle's avatar Paul Morelle
Browse files

[FIX] sale: flush field newly used in the query


In commit c04e7887, a new condition was added in the query in
AccountReconciliation._get_sales_order, which uses the computed field
amount_total. However, this field was not flushed in the previous line,
which may lead to inconsistent behaviors (at least in a test in
saas-13.2).

closes odoo/odoo#47929

Signed-off-by: default avatarOlivier Dony (odo) <odo@openerp.com>
parent 7b6b3df4
Branches
Tags
No related merge requests found
......@@ -11,7 +11,8 @@ class AccountReconciliation(models.AbstractModel):
if not stl_ids:
return res
# Search if we can find a sale order line that match the statement reference
self.env['sale.order'].flush(['name', 'reference', 'invoice_status', 'company_id', 'state', 'partner_id'])
self.env['sale.order'].flush(['name', 'reference', 'invoice_status', 'company_id',
'state', 'partner_id', 'amount_total'])
self.env['account.bank.statement.line'].flush(['name', 'partner_id'])
sql_query = """
SELECT stl.id, array_agg(o.id) AS order_id, stl.partner_id, array_agg(o.partner_id) as order_partner
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment