[FIX] document_page: allow other users than administrator to create menu to a static...
[odoo/odoo.git] / addons / account / account_pre_install.yml
1 -
2   I configure automatically if the country is set on the company, mainly for online offers.
3 -
4   !python {model: account.installer}: |
5     modules = self.pool.get('ir.module.module')
6     wizards = self.pool.get('ir.actions.todo')
7     wiz = wizards.browse(cr, uid, ref('account.account_configuration_installer_todo'))
8     part = self.pool.get('res.partner').browse(cr, uid, ref('base.main_partner'))
9     # if we know the country and the wizard has not yet been executed, we do it
10     if (part.country_id.id) and (wiz.state=='open'):
11         mod = 'l10n_'+part.country_id.code.lower()
12         ids = modules.search(cr, uid, [ ('name','=',mod) ], context=context)
13         if ids:
14             wizards.write(cr, uid, [ref('account.account_configuration_installer_todo')], {
15                 'state': 'done'
16             })
17             wiz_id = self.create(cr, uid, {
18                 'charts': mod
19             })
20             self.execute_simple(cr, uid, [wiz_id])
21             modules.state_update(cr, uid, ids,
22                 'to install', ['uninstalled'], context=context)