[fix] profile_service: migrate to res.config-based initial configuration
bzr revid: xmo@tinyerp.com-20091215152311-sb4cxygms426bftf
This commit is contained in:
@@ -24,6 +24,7 @@ import pooler
|
||||
|
||||
class profile_service_config_install_modules_wizard(osv.osv_memory):
|
||||
_name='profile.service.config.install_modules_wizard'
|
||||
_inherit = 'res.config'
|
||||
_rec_name = 'crm_configuration'
|
||||
_columns = {
|
||||
'crm_configuration':fields.boolean('CRM & Calendars', help="This installs the customer relationship features like: leads and opportunities tracking, shared calendar, jobs tracking, bug tracker, and so on."),
|
||||
@@ -46,31 +47,16 @@ class profile_service_config_install_modules_wizard(osv.osv_memory):
|
||||
help="An integrated wiki content management system. This is really "\
|
||||
"usefull to manage FAQ, quality manuals, etc.")
|
||||
}
|
||||
def action_cancel(self,cr,uid,ids,conect=None):
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
def action_install(self, cr, uid, ids, context=None):
|
||||
result=self.read(cr,uid,ids)
|
||||
def execute(self, cr, uid, ids, context=None):
|
||||
result = self.read(cr, uid, ids)
|
||||
mod_obj = self.pool.get('ir.module.module')
|
||||
for res in result:
|
||||
for r in res:
|
||||
if r<>'id' and res[r]:
|
||||
if r != 'id' and res[r]:
|
||||
ids = mod_obj.search(cr, uid, [('name', '=', r)])
|
||||
mod_obj.button_install(cr,uid,ids,context=context)
|
||||
mod_obj.button_install(cr, uid, ids, context=context)
|
||||
cr.commit()
|
||||
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
profile_service_config_install_modules_wizard()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -5,32 +5,37 @@
|
||||
<field name="name">Service Profile : Install extra modules</field>
|
||||
<field name="model">profile.service.config.install_modules_wizard</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.res_config_view_base"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Install Extra Module">
|
||||
<separator string="Services Management" colspan="4"/>
|
||||
<field name="project_timesheet"/>
|
||||
<field name="hr_timesheet_invoice"/>
|
||||
<field name="project_gtd"/>
|
||||
<field name="scrum"/>
|
||||
<field name="project_mrp"/>
|
||||
<separator string="Resources Management" colspan="4"/>
|
||||
<field name="hr_holidays"/>
|
||||
<field name="hr_expense"/>
|
||||
<field name="account_budget_crossover"/>
|
||||
<separator string="Relationship Management" colspan="4"/>
|
||||
<field name="crm_configuration"/>
|
||||
<field name="base_contact"/>
|
||||
<field name="board_document"/>
|
||||
<separator string="Portal Management" colspan="4"/>
|
||||
<field name="portal"/>
|
||||
<field name="wiki"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<label string="" colspan="2"/>
|
||||
<group col="4" colspan="2">
|
||||
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
|
||||
<button name="action_install" string="Install" icon='gtk-ok' type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
<data>
|
||||
<form position="attributes"><attribute name="string">
|
||||
Install Extra Modules
|
||||
</attribute></form>
|
||||
<group string="res_config_contents" position="replace">
|
||||
<label colspan="4" align="0.0" string="
|
||||
A few modules are proposed according to the
|
||||
'service profile' you selected. You will be able to
|
||||
install them or more modules later through the
|
||||
Administration menu."/>
|
||||
<separator string="Services Management" colspan="4"/>
|
||||
<field name="project_timesheet"/>
|
||||
<field name="hr_timesheet_invoice"/>
|
||||
<field name="project_gtd"/>
|
||||
<field name="scrum"/>
|
||||
<field name="project_mrp"/>
|
||||
<separator string="Resources Management" colspan="4"/>
|
||||
<field name="hr_holidays"/>
|
||||
<field name="hr_expense"/>
|
||||
<field name="account_budget_crossover"/>
|
||||
<separator string="Relationship Management" colspan="4"/>
|
||||
<field name="crm_configuration"/>
|
||||
<field name="base_contact"/>
|
||||
<field name="board_document"/>
|
||||
<separator string="Portal Management" colspan="4"/>
|
||||
<field name="portal"/>
|
||||
<field name="wiki"/>
|
||||
</group>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -38,6 +43,7 @@
|
||||
<field name="name">Service Profile : Install Extra Modules</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">profile.service.config.install_modules_wizard</field>
|
||||
<field name="view_id" ref="view_confirm_install_module_form"/>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
@@ -45,8 +51,6 @@
|
||||
|
||||
<record model="ir.actions.todo"
|
||||
id="config_install_module">
|
||||
<field name="name">Service Profile : Install Extra modules</field>
|
||||
<field name="note">A few modules are proposed according to the 'service profile' you selected. You will be able to install them or more modules later through the Administration menu.</field>
|
||||
<field name="action_id" ref="action_config_install_module"/>
|
||||
</record>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user