summaryrefslogtreecommitdiff
path: root/addons/base_setup
diff options
context:
space:
mode:
authorXavier Morel <xmo@tinyerp.com>2010-01-26 15:08:30 +0100
committerXavier Morel <xmo@tinyerp.com>2010-01-26 15:08:30 +0100
commit2e49aaa7ce33b601b983ec6bb368535426cdc148 (patch)
treeb725d7327d6a2ed823c41f9dc5c1799730ddf17d /addons/base_setup
parent349c2471aef6aea429464c62ccdb85f6c1411c09 (diff)
[imp] account, base_setup: move chart of accounts selection from base_setup installer to account's
Also remove it from account's config item as it's redundant Rationale: account can be installed due to dependency chains, not just direct installation from base_setup: project, stock, purchase and profile_auction all depend on account, mrp depends on stock which depends on account, so from base_setup's installer alone there are 5 different ways to end up with account installed and need to configure charts of accounts. Therefore having chart of accounts config in base_setup's installer is dumb (as we need a second one anyway), and since it's (in a way) a problem of module installation, the most coherent way is to move it to account/installer.py, and remove it from the config screen where it was (which becomes redundant). Made it required, because it was required in the config item, not sure it's actually mandatory to install a chart of accounts but whatever. bzr revid: xmo@tinyerp.com-20100126140830-h4c7hlvmzzos69ls
Diffstat (limited to 'addons/base_setup')
-rw-r--r--addons/base_setup/base_setup_installer.xml9
-rw-r--r--addons/base_setup/installer.py23
2 files changed, 4 insertions, 28 deletions
diff --git a/addons/base_setup/base_setup_installer.xml b/addons/base_setup/base_setup_installer.xml
index bf359ec306e..f9b490c2e98 100644
--- a/addons/base_setup/base_setup_installer.xml
+++ b/addons/base_setup/base_setup_installer.xml
@@ -25,11 +25,10 @@ If you don't think you need any of these right now, you can easily install them
<field name="crm"/> <field name="sale"/>
<field name="project"/> <field name="knowledge"/>
<field name="stock"/> <field name="mrp"/>
- <field name="account"/>
- <field name="charts" attrs="{'readonly':[('account','=',False)]}"/>
- <field name="purchase"/> <field name="hr"/>
- <field name="point_of_sale"/> <field name="marketing"/>
- <field name="misc_tools"/> <field name="report_designer"/>
+ <field name="account"/> <field name="purchase"/>
+ <field name="hr"/> <field name="point_of_sale"/>
+ <field name="marketing"/> <field name="misc_tools"/>
+ <field name="report_designer"/>
<separator string="Vertical Modules" colspan="4"/>
<field name="profile_association"/>
<field name="profile_training"/>
diff --git a/addons/base_setup/installer.py b/addons/base_setup/installer.py
index 3bdc34c48fa..2c1ba113e47 100644
--- a/addons/base_setup/installer.py
+++ b/addons/base_setup/installer.py
@@ -19,31 +19,12 @@
#
##############################################################################
from osv import fields, osv
-from itertools import chain
-from operator import itemgetter
import netsvc
class base_setup_installer(osv.osv_memory):
_name = 'base.setup.installer'
_inherit = 'res.config.installer'
- def _get_charts(self, cr, uid, context=None):
- modules = self.pool.get('ir.module.module')
- ids = modules.search(cr, uid, [('category_id','=','Account Charts'),
- ('state','!=','installed')])
- return list(
- sorted(((m.name, m.shortdesc)
- for m in modules.browse(cr, uid, ids)),
- key=itemgetter(1)))
-
- def _if_account(self, cr, uid, ids, context=None):
- chart = self.read(cr, uid, ids, ['charts'],
- context=context)[0]['charts']
- self.logger.notifyChannel(
- 'installer', netsvc.LOG_DEBUG,
- 'Addon "account" selected, installing chart of accounts %s'%chart)
- return [chart]
-
_install_if = {
('sale','crm'): ['sale_crm'],
('sale','project'): ['project_mrp'],
@@ -73,10 +54,6 @@ class base_setup_installer(osv.osv_memory):
'account':fields.boolean('Financial & Accounting',
help="Helps you handle your accounting needs, as well as create "
"and track your budgets."),
- 'charts':fields.selection(_get_charts, 'Chart of Accounts',
- help="Installs localized accounting charts to match as closely as "
- "possible the accounting needs of your company based on your "
- "country."),
'purchase':fields.boolean('Purchase Management',
help="Helps you manage your purchase-related processes such as "
"requests for quotations, supplier invoices, etc..."),