'Generate all the objects from the templates
:param company: company the wizard is running for
:param code_digits: number of digits the accounts code should have in the COA
:param transfer_account_id: reference to the account template that will be used as intermediary account for transfers between 2 liquidity accounts
:param acc_ref: Mapping between ids of account templates and real accounts created from them
:param taxes_ref: Mapping between ids of tax templates and real taxes created from them
:returns: tuple with a dictionary containing
* the mapping between the account template ids and the ids of the real accounts that have been generated
from them, as first item,
* a similar dictionary for mapping the tax templates and taxes, as second item,
:rtype: tuple(dict, dict, dict)'

@api.multi
def _load_template(self, company, code_digits=None, transfer_account_id=None, account_ref=None, taxes_ref=None):

    self.ensure_one()
    if (account_ref is None):
        account_ref = {}
    if (taxes_ref is None):
        taxes_ref = {}
    if (not code_digits):
        code_digits = self.code_digits
    if (not transfer_account_id):
        transfer_account_id = self.transfer_account_id
    AccountTaxObj = self.env['account.tax']
    generated_tax_res = self.tax_template_ids._generate_tax(company)
    taxes_ref.update(generated_tax_res['tax_template_to_tax'])
    account_template_ref = self.generate_account(taxes_ref, account_ref, code_digits, company)
    account_ref.update(account_template_ref)
    company.transfer_account_id = account_template_ref[transfer_account_id.id]
    for (key, value) in generated_tax_res['account_dict'].items():
        if (value['refund_account_id'] or value['account_id']):
            AccountTaxObj.browse(key).write({'refund_account_id': account_ref.get(value['refund_account_id'], False), 'account_id': account_ref.get(value['account_id'], False)})
    if (not self.parent_id):
        self.generate_journals(account_ref, company)
    self.generate_properties(account_ref, company)
    self.generate_fiscal_position(taxes_ref, account_ref, company)
    self.generate_account_reconcile_model(taxes_ref, account_ref, company)
    return (account_ref, taxes_ref)
