[fix] crm: migrate to res.config-based initial configuration
bzr revid: xmo@tinyerp.com-20091214144930-zm1b51yj1xyikgfn
This commit is contained in:
+4
-21
@@ -1109,12 +1109,14 @@ crm_email_add_cc_wizard()
|
||||
|
||||
class crm_calendar_config_wizard(osv.osv_memory):
|
||||
_name = 'crm.calendar.config_wizard'
|
||||
_inherit = 'res.config'
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64),
|
||||
'caldav': fields.boolean('Caldav Properties View', help="Manages the fields required for Caldav Properties.")
|
||||
}
|
||||
|
||||
def action_create(self, cr, uid, ids, context=None):
|
||||
|
||||
def execute(self, cr, uid, ids, context=None):
|
||||
res = self.read(cr, uid, ids)[0]
|
||||
idref = {}
|
||||
if res['caldav']:
|
||||
@@ -1126,26 +1128,7 @@ class crm_calendar_config_wizard(osv.osv_memory):
|
||||
if fp:
|
||||
tools.convert_xml_import(cr, 'crm', fp, idref, 'init', noupdate=True)
|
||||
cr.commit()
|
||||
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
}
|
||||
|
||||
def action_cancel(self, cr, uid, ids, context=None):
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
}
|
||||
|
||||
crm_calendar_config_wizard()
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -118,6 +118,8 @@ crm_cases()
|
||||
|
||||
class crm_menu_config_wizard(osv.osv_memory):
|
||||
_name = 'crm.menu.config_wizard'
|
||||
_inherit = 'res.config'
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64),
|
||||
'meeting': fields.boolean('Calendar of Meetings', help="Manages the calendar of meetings of the users."),
|
||||
@@ -137,7 +139,7 @@ class crm_menu_config_wizard(osv.osv_memory):
|
||||
'phonecall': lambda *args: True,
|
||||
}
|
||||
|
||||
def action_create(self, cr, uid, ids, context=None):
|
||||
def execute(self, cr, uid, ids, context=None):
|
||||
module_proxy = self.pool.get('ir.module.module')
|
||||
modid = module_proxy.search(cr, uid, [('name', '=', 'crm')])
|
||||
moddemo = module_proxy.browse(cr, uid, modid[0]).demo
|
||||
@@ -167,24 +169,6 @@ class crm_menu_config_wizard(osv.osv_memory):
|
||||
module_proxy.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',
|
||||
}
|
||||
|
||||
def action_cancel(self, cr, uid, ids, context=None):
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
}
|
||||
|
||||
crm_menu_config_wizard()
|
||||
|
||||
|
||||
|
||||
@@ -8,28 +8,34 @@
|
||||
<field name="name">Configure Menu for Sections</field>
|
||||
<field name="model">crm.menu.config_wizard</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.res_config_view_base"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Configure CRM Sections">
|
||||
<separator colspan="4" string="Install Pre-Configured Features"/>
|
||||
<label colspan="4" align="0.0" string="The CRM module of OpenERP is able to manage any kind of relationship. But, as to help you to start quickly on the system, we configured a few of them for you."/>
|
||||
<newline/>
|
||||
<field name="meeting"/>
|
||||
<field name="opportunity"/>
|
||||
<field name="phonecall"/>
|
||||
<field name="lead"/>
|
||||
<field name="claims"/>
|
||||
<field name="bugs"/>
|
||||
<field name="helpdesk"/>
|
||||
<field name="jobs"/>
|
||||
<field name="fund"/>
|
||||
<separator colspan="4" string="Calendar Sharing"/>
|
||||
<field name="document_ics"/>
|
||||
<newline/>
|
||||
<group col="4" colspan="4">
|
||||
<button icon="gtk-cancel" name="action_cancel" type="object" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-go-forward" name="action_create" string="Next" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
<data>
|
||||
<form position="attributes"><attribute name="string">
|
||||
Configure CRM Sections
|
||||
</attribute></form>
|
||||
|
||||
<group string="res_config_contents" position="replace">
|
||||
<separator colspan="4"
|
||||
string="Install Pre-Configured Features"/>
|
||||
<label colspan="4" align="0.0" string="
|
||||
The CRM module of OpenERP is able to manage any kind of
|
||||
relationship. But, as to help you to start quickly on the
|
||||
system, we configured a few of them for you."/>
|
||||
<newline/>
|
||||
<field name="meeting"/>
|
||||
<field name="opportunity"/>
|
||||
<field name="phonecall"/>
|
||||
<field name="lead"/>
|
||||
<field name="claims"/>
|
||||
<field name="bugs"/>
|
||||
<field name="helpdesk"/>
|
||||
<field name="jobs"/>
|
||||
<field name="fund"/>
|
||||
<separator colspan="4" string="Calendar Sharing"/>
|
||||
<field name="document_ics"/>
|
||||
</group>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -37,6 +43,7 @@
|
||||
<field name="name">Configure Menu for CRM case Section</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">crm.menu.config_wizard</field>
|
||||
<field name="view_id" ref="view_config_crm_menu"/>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
@@ -44,8 +51,6 @@
|
||||
|
||||
<!-- register configuration wizard -->
|
||||
<record id="config_wizard_step_case_section_menu" model="ir.actions.todo">
|
||||
<field name="name">Create Menu for CRM Case Section</field>
|
||||
<field name="note">This Configuration step use to create Menu for Case Sections</field>
|
||||
<field name="action_id" ref="action_view_config_crm_menu"/>
|
||||
</record>
|
||||
|
||||
|
||||
+16
-13
@@ -750,18 +750,22 @@
|
||||
<field name="name">Configure Menu for Caldav Properites</field>
|
||||
<field name="model">crm.calendar.config_wizard</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.res_config_view_base"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Configure view for Caldav Properites">
|
||||
<separator colspan="4" string=""/>
|
||||
<label colspan="4" align="0.0" string="This will provide a detailed view for caldav properties configuration"/>
|
||||
<newline/>
|
||||
<field name="caldav"/>
|
||||
<separator colspan="4" string=""/>
|
||||
<group col="4" colspan="4">
|
||||
<button icon="gtk-cancel" name="action_cancel" type="object" special="cancel" string="Cancel"/>
|
||||
<button icon="gtk-go-forward" name="action_create" string="Next" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
<data>
|
||||
<form position="attributes"><attribute name="string">
|
||||
Configure view for Caldav Properties
|
||||
</attribute></form>
|
||||
|
||||
<group string="res_config_contents" position="replace">
|
||||
<separator colspan="4" string=""/>
|
||||
<label colspan="4" align="0.0" string="
|
||||
Enable a detailed view of the caldav properties
|
||||
configuration."/>
|
||||
<newline/>
|
||||
<field name="caldav"/>
|
||||
</group>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -769,6 +773,7 @@
|
||||
<field name="name">Configure Menu for Caldav Properites</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">crm.calendar.config_wizard</field>
|
||||
<field name="view_id" ref="view_config_crm_caldav_menu"/>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
@@ -776,8 +781,6 @@
|
||||
|
||||
<!-- register configuration wizard -->
|
||||
<record id="config_wizard_step_cam_caldav_menu" model="ir.actions.todo">
|
||||
<field name="name">Configure Menu for Caldav Properites</field>
|
||||
<field name="note">This Configuration step use to provide a detailed view for caldav properties configuration</field>
|
||||
<field name="action_id" ref="action_view_config_crm_caldav_menu"/>
|
||||
</record>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user