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
if all(line.statement_id for line in record.payment_id.move_line_ids.filtered(lambda r: r.id != record.id and r.account_id.internal_type=='liquidity')):
                    record.payment_id.state = 'reconciled'
        result = super(AccountMoveLine, self).write(vals)
        if self._context.get('check_move_validity', True):
            move_ids = set()
            for line in self:
                if line.move_id.id not in move_ids:
                    move_ids.add(line.move_id.id)
            self.env['account.move'].browse(list(move_ids))._post_validate()
        return result
    @api.multi
    def _update_check(self):
        """ Raise Warning to cause rollback if the move is posted, some entries are reconciled or the move is older than the lock date"""
        move_ids = set()
        for line in self:
            err_msg = _('Move name (id): %s (%s)') % (line.move_id.name, str(line.move_id.id))
            if line.move_id.state != 'draft':
                raise UserError(_('You cannot do this modification on a posted journal entry, you can just change some non legal fields. You must revert the journal entry to cancel it.\n%s.') % err_msg)
            if line.reconciled and not (line.debit == 0 and line.credit == 0):
                raise UserError(_('You cannot do this modification on a reconciled entry. You can just change some non legal fields or you must unreconcile first.\n%s.') % err_msg)
            if line.move_id.id not in move_ids:
                move_ids.add(line.move_id.id)
            self.env['account.move'].browse(list(move_ids))._check_lock_date()
        return True
    
    # Mi
    
    @api.multi
    @api.depends('ref', 'move_id')
    def name_get(self):