[MOD] Configuration wizard : BI parameter wizard set with new format

bzr revid: vir@tinyerp.com-20100715064017-cilw9og986dhzvn8
This commit is contained in:
DBR(Open ERP) 2010-07-15 12:10:17 +05:30 committed by Vir (Open ERP)
parent 21335ab590
commit f2dbe510d4
2 changed files with 46 additions and 2 deletions

View File

@ -76,7 +76,30 @@
<field name="model">olap.parameters.config.wizard</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Parameters Configure">
<form string="Parameters Configure wizard">
<group colspan="4" col="8">
<group colspan="3" width="180" height="250">
<field name="config_logo" widget="image" width="200" height="100" nolabel="1" colspan="1"/>
<newline/>
<label align="0.0" string="This wizard will automatically configure the web client for Business Intelligence." width="200" colspan="2"/>
</group>
<separator string="" position="vertical" colspan="1" rowspan="12"/>
<group colspan="4">
<separator string=" Business Intelligence Web Client" colspan="4"/>
<field name="host_name" colspan="4"/>
<field name="host_port" colspan="4"/>
</group>
<group colspan="8" col="8">
<separator string="" colspan="8"/>
<group colspan="4" width="220">
<field name="progress" widget="progressbar" nolabel="1" colspan="2"/>
</group>
<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>
</group>
</form>
<!--form string="Parameters Configure">
<separator string="BI Web Client." colspan="4"/>
<label string="This wizard will automatically configure the web client for BI." align="0.0" colspan="4"/>
<field name="host_name" colspan="4"/>
@ -87,7 +110,7 @@
<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>
</form-->
</field>
</record>

View File

@ -30,6 +30,9 @@ from osv import osv
from osv import fields, osv
import netsvc
import cube
import os
import tools
import base64
from cube import levels
@ -2128,16 +2131,34 @@ class olap_parameters_config_wizard(osv.osv_memory):
Word(alphanums + "_" + " ").suppress()
return s_p.parseString(aid.url)[1]
def _get_image(self, cr, uid, context=None):
path = os.path.join('base','res','config_pixmaps/1.png')
file_data = tools.file_open(path,'rb').read()
return base64.encodestring(file_data)
def _progress(self, cr, uid, context=None):
total = self.pool.get('ir.actions.todo')\
.search_count(cr, uid, [], context)
open = self.pool.get('ir.actions.todo')\
.search_count(cr, uid, [('state','<>','open')], context)
if total:
return round(open*90./total)
return 100.
_columns = {
'host_name': fields.char('Server Name', size = 64, help = "Put here the server address or IP \
Put localhost if its not clear.", required = True),
'host_port': fields.char('Port', size = 4, help = "Put the port for the server. Put 8080 if \
its not clear.", required = True),
'config_logo': fields.binary('Image', readonly=True),
'progress': fields.float('Configuration Progress', readonly=True),
}
_defaults = {
'host_name': _get_host,
'host_port': _get_port,
'progress': _progress,
'config_logo': _get_image,
}
def action_cancel(self, cr, uid, ids, conect = None):