'install a chart of accounts for the given company (if required)'

@api.multi
def set_chart_of_accounts(self):

    if (self.chart_template_id and (not self.has_chart_of_accounts) and self.expects_chart_of_accounts):
        if (self.company_id.chart_template_id and (self.chart_template_id != self.company_id.chart_template_id)):
            raise UserError(_('You    can    not    change    a    company    chart    of    account    once    it    has    been    installed'))
        wizard = self.env['wizard.multi.charts.accounts'].create({'company_id': self.company_id.id, 'chart_template_id': self.chart_template_id.id, 'transfer_account_id': self.template_transfer_account_id.id, 'code_digits': (self.code_digits or 6), 'sale_tax_id': self.sale_tax_id.id, 'purchase_tax_id': self.purchase_tax_id.id, 'sale_tax_rate': self.sale_tax_rate, 'purchase_tax_rate': self.purchase_tax_rate, 'complete_tax_set': self.complete_tax_set, 'currency_id': self.currency_id.id, 'bank_account_code_prefix': (self.bank_account_code_prefix or self.chart_template_id.bank_account_code_prefix), 'cash_account_code_prefix': (self.cash_account_code_prefix or self.chart_template_id.cash_account_code_prefix)})
        wizard.execute()
