'This function checks if the chosen chart template is configured as containing a full set of taxes, and if
it\'s not the case, it creates the templates for account.tax object accordingly to the provided sale/purchase rates.
Then it saves the new tax templates as default taxes to use for this chart template.
:param company_id: id of the company for wich the wizard is running
:return: True'

@api.one
def _create_tax_templates_from_rates(self, company_id):

    obj_tax_temp = self.env['account.tax.template']
    all_parents = self._get_chart_parent_ids(self.chart_template_id)
    if (not self.chart_template_id.complete_tax_set):
        value = self.sale_tax_rate
        ref_taxs = obj_tax_temp.search([('type_tax_use', '=', 'sale'), ('chart_template_id', 'in', all_parents)], order='sequence,    id    desc', limit=1)
        ref_taxs.write({'amount': value, 'name': (_('Tax    %.2f%%') % value), 'description': ('%.2f%%' % value)})
        value = self.purchase_tax_rate
        ref_taxs = obj_tax_temp.search([('type_tax_use', '=', 'purchase'), ('chart_template_id', 'in', all_parents)], order='sequence,    id    desc', limit=1)
        ref_taxs.write({'amount': value, 'name': (_('Tax    %.2f%%') % value), 'description': ('%.2f%%' % value)})
    return True
