[fix] document: migrate to res.config-based initial configuration
bzr revid: xmo@tinyerp.com-20091214160843-zgbw9mad9cddf785
This commit is contained in:
@@ -718,6 +718,7 @@ document_file()
|
||||
class document_configuration_wizard(osv.osv_memory):
|
||||
_name='document.configuration.wizard'
|
||||
_description = 'Auto Directory configuration'
|
||||
_inherit = 'res.config'
|
||||
_rec_name = 'host'
|
||||
_columns = {
|
||||
'host': fields.char('Server Address', size=64, help="Put here the server address or IP. " \
|
||||
@@ -746,16 +747,7 @@ class document_configuration_wizard(osv.osv_memory):
|
||||
'port': get_ftp_server_port,
|
||||
}
|
||||
|
||||
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_config(self, cr, uid, ids, context=None):
|
||||
def execute(self, cr, uid, ids, context=None):
|
||||
conf = self.browse(cr, uid, ids[0], context)
|
||||
obj=self.pool.get('document.directory')
|
||||
objid=self.pool.get('ir.model.data')
|
||||
@@ -828,15 +820,6 @@ class document_configuration_wizard(osv.osv_memory):
|
||||
config['ftp_server_address'] = conf.host
|
||||
config['ftp_server_port'] = conf.port
|
||||
config.save()
|
||||
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
}
|
||||
|
||||
document_configuration_wizard()
|
||||
|
||||
|
||||
|
||||
@@ -249,8 +249,13 @@
|
||||
<field name="name">Auto Configure Directory</field>
|
||||
<field name="model">document.configuration.wizard</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.res_config_view_base"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Auto Configure">
|
||||
<data>
|
||||
<form position="attributes"><attribute name="string">
|
||||
Auto Configure
|
||||
</attribute></form>
|
||||
<group string="res_config_contents" position="replace">
|
||||
<separator string="Document Management System." colspan="4"/>
|
||||
<label string="This wizard will automatically configure the document management system according to modules installed on your system." align="0.0" colspan="4"/>
|
||||
<separator string="" colspan="4"/>
|
||||
@@ -258,13 +263,11 @@
|
||||
<field name="host" colspan="4"/>
|
||||
<field name="suggested_host" colspan="4"/>
|
||||
<field name="port" colspan="4"/>
|
||||
<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_config" string="Configure" icon='gtk-ok' type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</group>
|
||||
<xpath expr="//button[@name='action_next']" position="attributes">
|
||||
<attribute name="string">Configure</attribute>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -272,14 +275,13 @@
|
||||
<field name="name">Auto Configure Directory</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">document.configuration.wizard</field>
|
||||
<field name="view_id" ref="view_auto_config_form"/>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.todo" id="config_auto_directory">
|
||||
<field name="name">Auto Configure Directory</field>
|
||||
<field name="note">This wizard will configure the URL of the server of the document management system. These ftp server address and port will be stored in the configuration file.</field>
|
||||
<field name="action_id" ref="action_config_auto_directory"/>
|
||||
</record>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user