Hello everyone, 

why this line is inside the loop?

https://github.com/odoo/odoo/blob/132c7e75e57321c77aac9250a2587c74c5da7857/addons/account/models/account_move.py#L1364

We were removing 100k~ account.move.line records for testing purposes. It took ages. So we do some little investigation and saw this, we took out from the loop the process duration became minutes from hours.

Regards from Projet
res = super(AccountPartialReconcile, self).create(vals)
        if self._context.get('skip_full_reconcile_check'):
            #whe
            #rec
            return res
        #che
        #fir
        partial_rec_set = OrderedDict.fromkeys([x for x in res])
        aml_set = self.env['account.move.line']
        total_debit = 0
        total_credit = 0
        total_amount_currency = 0
        #mak
        #pos
        currency = list(partial_rec_set)[0].currency_id