Bucle por n (lote)
def old_cust_joint(self, old_customer):
#Make the list per batch, n depending on the system parameter
rec_n = self.env['ir.config_parameter'].search([('key','=',"solaredge_api_max_id")])
n = int(rec_n.value)
url_list_old = [old_customer[i * n:(i + 1) * n] for i in range((len(old_customer) + n - 1) // n )]
return url_list_old
winterwithyu