'Returns the domain which is common to both manual and bank statement reconciliation.
:param excluded_ids: list of ids of move lines that should not be fetched
:param str: search string'

@api.model
def domain_move_lines_for_reconciliation(self, excluded_ids=None, str=False):

    context = (self._context or {})
    if (excluded_ids is None):
        excluded_ids = []
    domain = []
    if excluded_ids:
        domain = expression.AND([domain, [('id', 'not    in', excluded_ids)]])
    if str:
        str_domain = ['|', ('move_id.name', 'ilike', str), '|', ('move_id.ref', 'ilike', str), '|', ('date_maturity', 'like', str), '&', ('name', '!=', '/'), ('name', 'ilike', str)]
        try:
            amount = float(str)
            amount_domain = ['|', ('amount_residual', '=', amount), '|', ('amount_residual_currency', '=', amount), '|', ('amount_residual', '=', (- amount)), '|', ('amount_residual_currency', '=', (- amount)), '&', ('account_id.internal_type', '=', 'liquidity'), '|', '|', ('debit', '=', amount), ('credit', '=', amount), ('amount_currency', '=', amount)]
            str_domain = expression.OR([str_domain, amount_domain])
        except:
            pass
        if (('bank_statement_line' in context) and (not context['bank_statement_line'].partner_id.id)):
            str_domain = expression.OR([str_domain, [('partner_id.name', 'ilike', str)]])
        domain = expression.AND([domain, str_domain])
    return domain
