'This method generate Fiscal Position, Fiscal Position Accounts and Fiscal Position Taxes from templates.
:param chart_temp_id: Chart Template Id.
:param taxes_ids: Taxes templates reference for generating account.fiscal.position.tax.
:param acc_template_ref: Account templates reference for generating account.fiscal.position.account.
:param company_id: company_id selected from wizard.multi.charts.accounts.
:returns: True'

@api.multi
def generate_fiscal_position(self, tax_template_ref, acc_template_ref, company):

    self.ensure_one()
    positions = self.env['account.fiscal.position.template'].search([('chart_template_id', '=', self.id)])
    for position in positions:
        new_fp = self.create_record_with_xmlid(company, position, 'account.fiscal.position', {'company_id': company.id, 'name': position.name, 'note': position.note})
        for tax in position.tax_ids:
            self.create_record_with_xmlid(company, tax, 'account.fiscal.position.tax', {'tax_src_id': tax_template_ref[tax.tax_src_id.id], 'tax_dest_id': ((tax.tax_dest_id and tax_template_ref[tax.tax_dest_id.id]) or False), 'position_id': new_fp})
        for acc in position.account_ids:
            self.create_record_with_xmlid(company, acc, 'account.fiscal.position.account', {'account_src_id': acc_template_ref[acc.account_src_id.id], 'account_dest_id': acc_template_ref[acc.account_dest_id.id], 'position_id': new_fp})
    return True
