[FIX] account: Use 'parent_state' instead of 'move_id.state'

closes odoo/odoo#94287

X-original-commit: fd51248bf4c5535b33fb5a6335dbb3b10cb1d2d9
Related: odoo/enterprise#28744
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
This commit is contained in:
Laurent Smet
2022-06-28 10:23:30 +02:00
parent f7af82def6
commit b2c8932db1
2 changed files with 2 additions and 1 deletions
@@ -973,7 +973,7 @@ class AccountBankStatementLine(models.Model):
return [
# Base domain.
('display_type', 'not in', ('line_section', 'line_note')),
('move_id.state', '=', 'posted'),
('parent_state', '=', 'posted'),
('company_id', '=', self.company_id.id),
# Reconciliation domain.
('reconciled', '=', False),
@@ -725,6 +725,7 @@ class AccountReconcileModel(models.Model):
)
) AS token
FROM {tables}
JOIN account_move account_move_line__move_id ON account_move_line__move_id.id = account_move_line.move_id
WHERE {where_clause} AND {table_alias}.{field} IS NOT NULL
''')