[IMP]: Improved default get code. Improved views. Fixed account chart error.

bzr revid: uco@tinyerp.com-20120301045621-ntwm1o22ruy7940u
This commit is contained in:
Ujjvala Collins (OpenERP)
2012-03-01 10:26:21 +05:30
parent 27fe954a1b
commit 2d1f03fa52
6 changed files with 14 additions and 11 deletions
+1
View File
@@ -66,6 +66,7 @@ class account_configuration(osv.osv_memory):
chart_template_obj = self.pool.get('account.chart.template')
tax_template_obj = self.pool.get('account.tax.template')
chart_template_ids = chart_template_obj.search(cr, uid, [('visible', '=', True)], context=context)
taxes = []
if chart_template_ids:
taxes = tax_template_obj.search(cr, uid, [('chart_template_id', '=', chart_template_ids[0])], context=context)
result = {}
@@ -119,10 +119,8 @@
<field name="arch" type="xml">
<field name="account_analytic_analysis" position="after">
<newline/>
<field name="analytic_user_function"/>
<newline/>
<field name="analytic_journal_billing_rate"/>
<newline/>
<field name="analytic_user_function" attrs="{'invisible': [('account_analytic_analysis','=',False)]}"/>
<field name="analytic_journal_billing_rate" attrs="{'invisible': [('account_analytic_analysis','=',False)]}"/>
</field>
</field>
</record>
+1 -1
View File
@@ -20,7 +20,7 @@
<field name="is_ssl" on_change="onchange_server_type(type, is_ssl)"/>
<newline/>
<field name="user" attrs="{'required': [('fetchmail_crm','=',True)]}"/>
<field name="password" attrs="{'required': [('fetchmail_crm','=',True)]}"/>
<field name="password" password="True" attrs="{'required': [('fetchmail_crm','=',True)]}"/>
</group>
</group>
</xpath>
+1 -1
View File
@@ -55,7 +55,7 @@
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="arch" type="xml">
<field name="plugin_outlook" position="after">
<button name="%(action_outlook_installer)d" type="action" string="Configure Outlook Plug-In" icon="gtk-execute" colspan="2"/>
<button name="%(action_outlook_installer)d" type="action" string="Configure" icon="gtk-execute"/>
</field>
</field>
</record>
@@ -62,7 +62,7 @@
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="arch" type="xml">
<field name="plugin_thunderbird" position="after">
<button name="%(action_thunderbird_installer)d" type="action" string="Configure Thunderbird Plug-In" icon="gtk-execute" colspan="2"/>
<button name="%(action_thunderbird_installer)d" type="action" string="Configure" icon="gtk-execute"/>
</field>
</field>
</record>
+8 -4
View File
@@ -102,6 +102,10 @@ class sale_configuration(osv.osv_memory):
('state','in',['to install', 'installed', 'to upgrade'])],
context=context)
installed_modules = dict([(mod.name,True) for mod in module_obj.browse(cr, uid, module_ids, context=context)])
if installed_modules.get('project_mrp') and installed_modules.get('project_timesheet'):
installed_modules['task_work'] = True
if installed_modules.get('account_analytic_analysis'):
installed_modules['timesheet'] = True
return installed_modules
def get_default_sale_configs(self, cr, uid, ids, context=None):
@@ -162,11 +166,11 @@ class sale_configuration(osv.osv_memory):
def set_modules(self, cr, uid, ids, vals, context=None):
module_obj = self.pool.get('ir.module.module')
MODULE_LIST = vals.get('modules')
if vals.get('task_work'):
vals.update({'project_timesheet': True,'project_mrp': True})
if vals.get('timesheet'):
vals.update({'account_analytic_analysis': True})
for k, v in vals.items():
if k == 'task_work':
MODULE_LIST += ['project_timesheet','project_mrp']
if k == 'timesheet':
MODULE_LIST += ['account_analytic_analysis']
if k in MODULE_LIST:
installed = self.get_default_installed_modules(cr, uid, [k], context)
if v == True and not installed.get(k):