Impacted versions:
At least version 10, version 11(Can only re-produce the problem sometimes)

Steps to reproduce:
Please see this screencast recorded on odoo runbot.
https://youtu.be/cSPQvp9jQJc

Current behavior:
When users search by account in Journal Entries List View. A special value "dummy_account_id" is set in context, in order to facilitate search by account on account.move level.
With this context value , when users create a journal entries, the system will add default value before the creation.

https://github.com/odoo/odoo/blob/fc69b37cf710623ea215cd085e998679d8c50985/odoo/models.py#L3802

This method will set "dummy_account_id" to the previously searched account in vals.

Then the system continue creating account.move and related account.move.line records.
It is fine until the system run this:
https://github.com/odoo/odoo/blob/fc69b37cf710623ea215cd085e998679d8c50985/odoo/models.py#L3830

Since "dummy_account_id" is related field, and it now has value. The system will change the first related  account.move.line record to dummy_account_id.

Eventualy, the account is wrongly set to "dummy_account_id".

Expected behavior:
This is a feature which will fill the form field value with searched value for users. But the journal entry creation should not be affected by dummy_account_id, since it is only for searching purpose.

@Yenthe666 Would you please review this issue and help to bring related odoo staff to this issue?
addons/account/models/account_move.py
""" Returns the data required for the invoices & payments matching of partners/accounts (list of dicts).
            If no res_ids is passed, returns data for all partners/accounts that can be reconciled.
            :param res_type: either 'partner' or 'account'
            :param res_ids: ids of the partners/accounts to reconcile, use None to fetch data indiscriminately
                of the id, use [] to prevent from fetching any data at all.
            :param account_type: if a partner is both customer and vendor, you can use 'payable' to reconcile
                the vendor-related journal entries and 'receivable' for the customer-related entries.
        """
        if res_ids is not None and len(res_ids) == 0:
            
            
            return []
        res_ids = res_ids and tuple(res_ids)
        assert res_type in ('partner', 'account')
        assert account_type in ('payable', 'receivable', None)
        is_partner = res_type == 'partner'
        res_alias = is_partner and 'p' or 'a'
        query = ("""
            SELECT {0} account_id, account_name, account_code, max_date,
                   to_char(last_time_entries_checked, 'YYYY-MM-DD') AS last_time_entries_checked
            FROM (
                    SELECT {1}
                        {res_alias}.last_time_entries_checked AS last_time_entries_checked,
                        a.id AS account_id,
                        a.name AS account_name,
                        a.code AS account_code,
                        MAX(l.write_date) AS max_date
                    FROM