summaryrefslogtreecommitdiff
path: root/addons/base_setup/wizard/wizard_base_setup.py
diff options
context:
space:
mode:
authorMustufa Rangwala <mra@tinyerp.com>2008-08-26 13:46:03 +0530
committerMustufa Rangwala <mra@tinyerp.com>2008-08-26 13:46:03 +0530
commitde04df653b0072e81e8b3e1f89bbc2187e041d82 (patch)
treea71a03cfda8cb4377d0bea3f2eeef074a1c5308f /addons/base_setup/wizard/wizard_base_setup.py
parenta2c1dd98d5269b49ac7f89be2f43cc9cc17f97ca (diff)
parentcaae11daa1d980cf7dede299d1c56812cc303f20 (diff)
changes
bzr revid: mra@tinyerp.com-20080826081603-4vlg3q7he8aphss7
Diffstat (limited to 'addons/base_setup/wizard/wizard_base_setup.py')
-rw-r--r--addons/base_setup/wizard/wizard_base_setup.py50
1 files changed, 42 insertions, 8 deletions
diff --git a/addons/base_setup/wizard/wizard_base_setup.py b/addons/base_setup/wizard/wizard_base_setup.py
index ce512679722..83bb13644cf 100644
--- a/addons/base_setup/wizard/wizard_base_setup.py
+++ b/addons/base_setup/wizard/wizard_base_setup.py
@@ -62,6 +62,20 @@ view_form_charts = """<?xml version="1.0"?>
</group>
</form>"""
+view_form_vatcheck = """<?xml version="1.0"?>
+<form string="Setup">
+ <image name="gtk-dialog-info" colspan="2"/>
+ <group>
+ <separator string="Install 'base_vat_check' module" colspan="2"/>
+ <newline/>
+ <field name="vatcheck" align="0.0"/>
+ <newline/>
+ <label string="This module allow you to force the validation of the VAT number. This module is optional but highly recommanded." colspan="2" align="0.0"/>
+ <newline/>
+ <label string="If you don't install it now, you'll be able to install it through the Administration menu." colspan="2" align="0.0"/>
+ </group>
+</form>"""
+
view_form_company = """<?xml version="1.0"?>
<form string="Setup">
<image name="gtk-dialog-info" colspan="2"/>
@@ -97,6 +111,8 @@ view_form_update = """<?xml version="1.0"?>
<newline/>
<field name="charts" align="0.0" readonly="1"/>
<newline/>
+ <field name="vatcheck" align="0.0" readonly="1"/>
+ <newline/>
<field name="name" align="0.0" readonly="1"/>
</group>
</form>
@@ -185,12 +201,16 @@ class wizard_base_setup(wizard.interface):
def _update(self, cr, uid, data, context):
pool=pooler.get_pool(cr.dbname)
form=data['form']
- if 'profile' in data['form'] and data['form']['profile'] > 0:
- module_obj=pool.get('ir.module.module')
- module_obj.state_update(cr, uid, [data['form']['profile']], 'to install', ['uninstalled'], context)
- if 'charts' in data['form'] and data['form']['charts'] > 0:
- module_obj=pool.get('ir.module.module')
- module_obj.state_update(cr, uid, [data['form']['charts']], 'to install', ['uninstalled'], context)
+ module_obj=pool.get('ir.module.module')
+
+ if 'profile' in form and form['profile'] > 0:
+ module_obj.state_update(cr, uid, [form['profile']], 'to install', ['uninstalled'], context)
+ if 'charts' in form and form['charts'] > 0:
+ module_obj.state_update(cr, uid, [form['charts']], 'to install', ['uninstalled'], context)
+ if 'vatcheck' in form and form['vatcheck']:
+ mid = module_obj.search(cr, uid, [('name', '=', 'base_vat_check')], context=context)
+ if mid:
+ module_obj.state_update(cr, uid, mid, 'to install', ['uninstalled'], context)
company_obj=pool.get('res.company')
partner_obj=pool.get('res.partner')
@@ -271,7 +291,7 @@ class wizard_base_setup(wizard.interface):
def _previous(self, cr, uid, data, context):
if 'profile' not in data['form'] or data['form']['profile'] <= 0:
return 'init'
- return 'charts'
+ return 'vatcheck'
def _config(self, cr, uid, data, context=None):
users_obj=pooler.get_pool(cr.dbname).get('res.users')
@@ -307,6 +327,11 @@ class wizard_base_setup(wizard.interface):
'default': -1,
'required': True,
},
+ 'vatcheck':{
+ 'string': "Install 'base_vat_check' module",
+ 'type': 'boolean',
+ 'default': False,
+ },
'name':{
'string': 'Company Name',
'type': 'char',
@@ -402,6 +427,15 @@ IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701""",
'result': {'type': 'form', 'arch': view_form_charts, 'fields': fields,
'state':[
('init', 'Previous', 'gtk-go-back'),
+ ('vatcheck', 'Next', 'gtk-go-forward', True)
+ ]
+ }
+ },
+ 'vatcheck':{
+ 'actions':[],
+ 'result': {'type': 'form', 'arch': view_form_vatcheck, 'fields': fields,
+ 'state': [
+ ('charts', 'Previous', 'gtk-go-back'),
('company', 'Next', 'gtk-go-forward', True)
]
}
@@ -424,7 +458,7 @@ IBAN: BE74 1262 0121 6907 - SWIFT: CPDF BE71 - VAT: BE0477.472.701""",
'result': {'type': 'form', 'arch': view_form_update, 'fields': fields,
'state': [
('company', 'Previous', 'gtk-go-back'),
- ('finish', 'Install', 'gtk-ok', True)
+ ('finish', 'Install', 'gtk-save', True)
]
}
},