summaryrefslogtreecommitdiff
path: root/bin/addons/base/module/wizard
diff options
context:
space:
mode:
authorVir (Open ERP) <vir@tinyerp.com>2010-10-05 10:04:57 +0530
committerVir (Open ERP) <vir@tinyerp.com>2010-10-05 10:04:57 +0530
commitaf76cb9af7b7bccf9cd975adaa3cb27ff1aa1d67 (patch)
tree656dfb76968fbe97ccbf28cfa2c3a49972efcab6 /bin/addons/base/module/wizard
parent53b35c7d6eb8a1a046fbac056acd4f08093441ff (diff)
parent863766e16afe32b046e5e5bf0f7e0a6384be025b (diff)
[Merge]
bzr revid: vir@tinyerp.com-20101005043457-bxgzubu7m9teawws
Diffstat (limited to 'bin/addons/base/module/wizard')
-rw-r--r--bin/addons/base/module/wizard/base_export_language.py13
-rw-r--r--bin/addons/base/module/wizard/base_export_language_view.xml54
-rw-r--r--bin/addons/base/module/wizard/base_import_language.py2
-rw-r--r--bin/addons/base/module/wizard/base_import_language_view.xml57
-rw-r--r--bin/addons/base/module/wizard/base_language_install.py36
-rw-r--r--bin/addons/base/module/wizard/base_language_install_view.xml64
-rw-r--r--bin/addons/base/module/wizard/base_module_configuration.py2
-rw-r--r--bin/addons/base/module/wizard/base_module_configuration_view.xml6
-rw-r--r--bin/addons/base/module/wizard/base_module_import.py67
-rw-r--r--bin/addons/base/module/wizard/base_module_import_view.xml80
-rw-r--r--bin/addons/base/module/wizard/base_module_scan.py5
-rw-r--r--bin/addons/base/module/wizard/base_module_update.py80
-rw-r--r--bin/addons/base/module/wizard/base_module_update_view.xml72
-rw-r--r--bin/addons/base/module/wizard/base_module_upgrade.py8
-rw-r--r--bin/addons/base/module/wizard/base_module_upgrade_view.xml2
-rw-r--r--bin/addons/base/module/wizard/base_update_translations.py13
-rw-r--r--bin/addons/base/module/wizard/base_update_translations_view.xml29
17 files changed, 259 insertions, 331 deletions
diff --git a/bin/addons/base/module/wizard/base_export_language.py b/bin/addons/base/module/wizard/base_export_language.py
index ca2e3059cfb..1b43b561ac3 100644
--- a/bin/addons/base/module/wizard/base_export_language.py
+++ b/bin/addons/base/module/wizard/base_export_language.py
@@ -68,6 +68,7 @@ class base_language_export(osv.osv_memory):
return self.write(cr, uid, ids, {'state':'get', 'data':out, 'advice':this.advice, 'name':this.name}, context=context)
_name = "base.language.export"
+ _inherit = "ir.wizard.screen"
_columns = {
'name': fields.char('Filename', 16, readonly=True),
'lang': fields.selection(_get_languages, 'Language', help='To export a new language, do not select a language.'), # not required: unset = new language
@@ -78,11 +79,11 @@ class base_language_export(osv.osv_memory):
'state': fields.selection( ( ('choose','choose'), # choose language
('get','get'), # get the file
) ),
- }
- _defaults = { 'state': lambda *a: 'choose',
- 'name': lambda *a: 'lang.tar.gz'
- }
+ }
+ _defaults = {
+ 'state': lambda *a: 'choose',
+ 'name': lambda *a: 'lang.tar.gz'
+ }
base_language_export()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file
diff --git a/bin/addons/base/module/wizard/base_export_language_view.xml b/bin/addons/base/module/wizard/base_export_language_view.xml
index cae515425d5..c908c5ce03a 100644
--- a/bin/addons/base/module/wizard/base_export_language_view.xml
+++ b/bin/addons/base/module/wizard/base_export_language_view.xml
@@ -3,16 +3,27 @@
<data>
<record id="wizard_lang_export" model="ir.ui.view">
- <field name="name">Export a Translation File</field>
+ <field name="name">Export Translations</field>
<field name="model">base.language.export</field>
<field name="type">form</field>
<field name="arch" type="xml">
- <form string="Export language">
- <notebook>
- <page string="Export Data">
+ <form string="Export Translations">
+ <group col="8">
+ <group colspan="3">
+ <field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
+ <newline/>
+ <label colspan="4" width="220" string="OpenERP translations (core, modules, clients) are managed through Launchpad.net, our open source project management facility. We use their online interface to synchronize all translations efforts."/>
+ <label colspan="4" width="220" string="To improve or expand the official translations, you should use directly Lauchpad's web interface (Rosetta). If you need to perform mass translation, Launchpad also allows uploading full .po files at once"/>
+ <label colspan="4" width="220"/>
+ <label colspan="4" width="220" string="To browse official translations, you can start with these links:"/>
+ <label colspan="4" width="220" string="https://help.launchpad.net/Translations"/>
+ <label colspan="4" width="220" string="https://translations.launchpad.net/openobject"/>
+ </group>
+ <separator orientation="vertical" rowspan="15"/>
+ <group colspan="4">
<group colspan="4" states="choose">
- <separator colspan="4" string="Export translation file"/>
- <field name="lang" required="1"/>
+ <separator colspan="4" string="Export Translation"/>
+ <field name="lang"/>
<field name="format" required="1"/>
<field height="200" name="modules" nolabel="1" colspan="4"/>
<field invisible="1" name="state"/>
@@ -23,28 +34,25 @@
<field name="data" nolabel="1" readonly="1" fieldname="name" colspan="4"/>
<field height="80" name="advice" nolabel="1" colspan="4"/>
</group>
- <separator string="" colspan="4"/>
- <group col="2" colspan="2">
- </group>
- <group col="2" colspan="2">
- <button icon="gtk-cancel" name="act_cancel" special="cancel" states="choose" string="_Cancel" type="object"/>
- <button icon="gtk-ok" name="act_getfile" states="choose" string="_Export" type="object"></button>
- <button icon="gtk-cancel" name="act_destroy" special="cancel" states="get" string="_Cancel" type="object"/>
- </group>
- </page>
- <page string="Help">
- <label align="0.0" colspan="4" string="The official translations pack of all OpenERP/OpenObjects module are managed through launchpad. We use their online interface to synchronize all translations efforts."/>
- <label align="0.0" colspan="4" string="To improve some terms of the official translations of OpenERP, you should modify the terms directly on the launchpad interface. If you made lots of translations for your own module, you can also publish all your translation at once."/>
- <label align="0.0" colspan="4" string="To browse official translations, you can visit this link: "/>
- <label align="0.0" colspan="4" string="https://translations.launchpad.net/openobject"/>
- </page>
- </notebook>
+ </group>
+ <group colspan="8" col="8" states="choose">
+ <separator string="" colspan="8"/>
+ <label colspan="6" width="220"/>
+ <button icon="gtk-cancel" name="act_cancel" special="cancel" string="_Close" type="object"/>
+ <button icon="gtk-ok" name="act_getfile" string="_Export" type="object"/>
+ </group>
+ <group colspan="8" col="8" states="get">
+ <separator string="" colspan="8"/>
+ <label colspan="7" width="220"/>
+ <button icon="gtk-close" name="act_destroy" special="cancel" string="_Close" type="object"/>
+ </group>
+ </group>
</form>
</field>
</record>
<record id="action_wizard_lang_export" model="ir.actions.act_window">
- <field name="name">Export a Translation File</field>
+ <field name="name">Export Translation</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">base.language.export</field>
<field name="view_type">form</field>
diff --git a/bin/addons/base/module/wizard/base_import_language.py b/bin/addons/base/module/wizard/base_import_language.py
index ca45c0a6c1c..6608ade03ef 100644
--- a/bin/addons/base/module/wizard/base_import_language.py
+++ b/bin/addons/base/module/wizard/base_import_language.py
@@ -21,7 +21,6 @@
import tools
import base64
-import pooler
from tempfile import TemporaryFile
from osv import osv, fields
@@ -30,6 +29,7 @@ class base_language_import(osv.osv_memory):
_name = "base.language.import"
_description = "Language Import"
+ _inherit = "ir.wizard.screen"
_columns = {
'name': fields.char('Language Name',size=64 , required=True),
diff --git a/bin/addons/base/module/wizard/base_import_language_view.xml b/bin/addons/base/module/wizard/base_import_language_view.xml
index eb73e8d4370..c7cdac663b5 100644
--- a/bin/addons/base/module/wizard/base_import_language_view.xml
+++ b/bin/addons/base/module/wizard/base_import_language_view.xml
@@ -3,42 +3,42 @@
<data>
<record id="view_base_import_language" model="ir.ui.view">
- <field name="name">Import Language</field>
+ <field name="name">Import Translation</field>
<field name="model">base.language.import</field>
<field name="type">form</field>
<field name="arch" type="xml">
- <form string="Import language">
- <notebook colspan="4">
- <page string="Import Data">
- <group colspan="4" col="4">
- <separator string="Import New Language" colspan="4"/>
- <field name="name" width="200"/>
- <field name="code"/>
- <field name="data" colspan="4"/>
+ <form string="Import Translation">
+ <group col="8">
+ <group colspan="3">
+ <field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
+ <newline/>
+ <label colspan="4" width="220" string="Supported file formats: *.csv (Comma-separated values) or *.po (GetText Portable Objects)"/>
+ <label colspan="4" width="220" string="Please double-check that the file encoding is set to UTF-8 (sometimes called Unicode) when the translator exports it."/>
+ <label colspan="4" width="220"/>
+ <label colspan="4" width="220" string="When using CSV format, please also check that the first line of your file is one of the following:"/>
+ <label colspan="4" width="220" string="- type,name,res_id,src,value"/>
+ <label colspan="4" width="220" string="- module,type,name,res_id,src,value"/>
+ </group>
+ <separator orientation="vertical" rowspan="15"/>
+ <group colspan="4" col="4">
+ <separator string="Import Translation" colspan="4"/>
+ <field name="name" width="200"/>
+ <field name="code"/>
+ <field name="data" colspan="4"/>
+ </group>
+ <group colspan="8" col="8">
+ <separator string="" colspan="8"/>
+ <label colspan="6" width="220"/>
+ <button special="cancel" string="_Close" icon="gtk-cancel"/>
+ <button name="import_lang" string="_Import" type="object" icon="gtk-ok"/>
+ </group>
</group>
- <separator string="" colspan="4"/>
- <group colspan="2" col="2">
- </group>
- <group colspan="2" col="2">
- <button special="cancel" string="_Cancel" icon="gtk-cancel"/>
- <button name="import_lang" string="_Import" type="object" icon="gtk-ok"/>
- </group>
- </page>
- <page string="Help">
- <label string="You have to import a .CSV file which is encoded in UTF-8."/>
- <label string="Please check that the first line of your file is one of the following:" colspan="4" align="0.0"/>
- <label string="type,name,res_id,src,value" colspan="4"/>
- <label string="module,type,name,res_id,src,value" colspan="4"/>
- <label string="You can also import .po files." colspan="4" align="0.0"/>
- </page>
- </notebook>
-
- </form>
+ </form>
</field>
</record>
<record id="action_view_base_import_language" model="ir.actions.act_window">
- <field name="name">Import Language</field>
+ <field name="name">Import Translation</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">base.language.import</field>
<field name="view_type">form</field>
@@ -47,7 +47,6 @@
</record>
<menuitem
- name="Import a Translation File"
action="action_view_base_import_language"
id="menu_view_base_import_language"
parent="menu_translation_export"/>
diff --git a/bin/addons/base/module/wizard/base_language_install.py b/bin/addons/base/module/wizard/base_language_install.py
index 140cc4cc033..7a3b8cc75aa 100644
--- a/bin/addons/base/module/wizard/base_language_install.py
+++ b/bin/addons/base/module/wizard/base_language_install.py
@@ -20,17 +20,22 @@
##############################################################################
import tools
-import pooler
from osv import osv, fields
class base_language_install(osv.osv_memory):
""" Install Language"""
_name = "base.language.install"
+ _inherit = "ir.wizard.screen"
_description = "Install Language"
_columns = {
- 'lang': fields.selection(tools.scan_languages(),'Language'),
+ 'lang': fields.selection(tools.scan_languages(),'Language', required=True),
+ 'state':fields.selection([('init','init'),('done','done')], 'state', readonly=True),
+ }
+
+ _defaults = {
+ 'state': 'init',
}
def lang_install(self, cr, uid, ids, context):
@@ -40,30 +45,9 @@ class base_language_install(osv.osv_memory):
modobj = self.pool.get('ir.module.module')
mids = modobj.search(cr, uid, [('state', '=', 'installed')])
modobj.update_translations(cr, uid, mids, lang)
-
- data_obj = self.pool.get('ir.model.data')
- id2 = data_obj._get_id(cr, uid, 'base', 'view_base_language_install_msg')
- if id2:
- id2 = data_obj.browse(cr, uid, id2, context=context).res_id
-
- return {
- 'view_type': 'form',
- 'view_mode': 'form',
- 'res_model': 'base.module.import.msg',
- 'views': [(id2, 'form')],
- 'view_id': False,
- 'type': 'ir.actions.act_window',
- 'target': 'new',
- }
+ self.write(cr, uid, ids, {'state': 'done'}, context=context)
+ return False
base_language_install()
-class base_language_install_msg(osv.osv_memory):
- """ Install Language"""
-
- _name = "base.language.install.msg"
- _description = "Install Language"
-
-base_language_install_msg()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file
diff --git a/bin/addons/base/module/wizard/base_language_install_view.xml b/bin/addons/base/module/wizard/base_language_install_view.xml
index 794ea6bed7d..38edf4d4a82 100644
--- a/bin/addons/base/module/wizard/base_language_install_view.xml
+++ b/bin/addons/base/module/wizard/base_language_install_view.xml
@@ -8,13 +8,38 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Load Official Translation">
- <separator string="Load an Official Translation" colspan="4"/>
- <group colspan="4"><field name="lang"/></group>
- <label string="" colspan="4"/>
- <label string="Please be patient, as this operation may take a few minutes..." colspan="4"/>
- <separator string="" colspan="4"/>
- <button special="cancel" string="Cancel" icon="gtk-cancel"/>
- <button name="lang_install" string="Load" type="object" icon="gtk-ok"/>
+ <group col="8">
+ <group colspan="3">
+ <field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
+ <newline/>
+ <label colspan="4" width="220" string="This wizard helps you add a new language to your OpenERP system. After loading a new language it becomes available as default interface language for users and partners."/>
+ <label colspan="4" width="220"/>
+ <label colspan="4" width="220" string="Please be patient, this operation may take a few minutes (depending on the number of modules currently installed)..."/>
+ <field name="state" invisible="1"/>
+ </group>
+ <separator orientation="vertical" rowspan="15"/>
+ <group colspan="4">
+ <separator string="Load Official Translation" colspan="4"/>
+ <group states="init" colspan="4">
+ <field name="lang" colspan="4"/>
+ </group>
+ <group states="done" colspan="4">
+ <label string="The selected language has been successfully installed.
+You must change the preferences of the user and open a new menu to view the changes." colspan="4"/>
+ </group>
+ </group>
+ <group colspan="8" col="8" states="init">
+ <separator string="" colspan="8"/>
+ <label colspan="6" width="220"/>
+ <button special="cancel" string="Cancel" icon="gtk-cancel"/>
+ <button name="lang_install" string="Load" type="object" icon="gtk-ok"/>
+ </group>
+ <group colspan="8" col="8" states="done">
+ <separator string="" colspan="8"/>
+ <label colspan="7" width="220"/>
+ <button special="cancel" string="Close" icon="gtk-ok"/>
+ </group>
+ </group>
</form>
</field>
</record>
@@ -32,30 +57,7 @@
name="Load an Official Translation"
action="action_view_base_language_install"
id="menu_view_base_language_install"
- parent="menu_translation"/>
-
- <record id="view_base_language_install_msg" model="ir.ui.view">
- <field name="name">Official Translation Loaded</field>
- <field name="model">base.module.import.msg</field>
- <field name="type">form</field>
- <field name="arch" type="xml">
- <form string="Official Translation Loaded">
- <separator string="Official Translation Loaded" colspan="4"/>
- <label string="The selected language has been successfully installed.\nYou must change the preferences of the user and open a new menu to view the changes." colspan="4"/>
- <separator string="" colspan="4"/>
- <button special="cancel" string="OK" icon="gtk-ok"/>
- </form>
- </field>
- </record>
-
- <record id="action_view_base_language_install_msg" model="ir.actions.act_window">
- <field name="name">Official Translation Loaded</field>
- <field name="res_model">base.module.import.msg</field>
- <field name="view_type">form</field>
- <field name="view_mode">form</field>
- <field name="view_id" ref="view_base_language_install"/>
- <field name="target">new</field>
- </record>
+ parent="menu_translation" sequence="2"/>
</data>
</openerp>
diff --git a/bin/addons/base/module/wizard/base_module_configuration.py b/bin/addons/base/module/wizard/base_module_configuration.py
index 909637c1d21..345ed9a9797 100644
--- a/bin/addons/base/module/wizard/base_module_configuration.py
+++ b/bin/addons/base/module/wizard/base_module_configuration.py
@@ -27,7 +27,7 @@ class base_module_configuration(osv.osv_memory):
_name = "base.module.configuration"
def start(self, cr, uid, ids, context=None):
- todo_ids = self.pool.get('ir.actions.todo').search(cr, uid, ['|', ('state', '=', 'open'), ('restart', '=', 'always')])
+ todo_ids = self.pool.get('ir.actions.todo').search(cr, uid, ['|', ('state', '=', 'open'), '&', ('state', '=', 'skip'), ('restart', '=', 'onskip')])
if not todo_ids:
# When there is no wizard todo it will display message
data_obj = self.pool.get('ir.model.data')
diff --git a/bin/addons/base/module/wizard/base_module_configuration_view.xml b/bin/addons/base/module/wizard/base_module_configuration_view.xml
index 559273be8a9..e5ad8f720bd 100644
--- a/bin/addons/base/module/wizard/base_module_configuration_view.xml
+++ b/bin/addons/base/module/wizard/base_module_configuration_view.xml
@@ -26,8 +26,8 @@
<menuitem name="Start Configuration"
action="action_start_configurator"
- id="menu_view_base_module_configuration" parent="next_id_11"
- type="server" icon="STOCK_EXECUTE" sequence="2" />
+ id="menu_view_base_module_configuration" parent="base.menu_config"
+ type="server" icon="STOCK_EXECUTE" sequence="100" />
<record model="ir.values" id="action_todo_config">
<field name="model_id" ref="model_ir_actions_todo" />
@@ -38,6 +38,6 @@
<field name="key">action</field>
<field name="model">ir.actions.todo</field>
</record>
-
+
</data>
</openerp>
diff --git a/bin/addons/base/module/wizard/base_module_import.py b/bin/addons/base/module/wizard/base_module_import.py
index 990a77ce8cd..68822690f45 100644
--- a/bin/addons/base/module/wizard/base_module_import.py
+++ b/bin/addons/base/module/wizard/base_module_import.py
@@ -19,8 +19,6 @@
#
##############################################################################
-
-import pooler
import os
import tools
@@ -34,19 +32,24 @@ class base_module_import(osv.osv_memory):
""" Import Module """
_name = "base.module.import"
+ _inherit = "ir.wizard.screen"
_description = "Import Module"
_columns = {
'module_file': fields.binary('Module .ZIP file', required=True),
+ 'state':fields.selection([('init','init'),('done','done')], 'state', readonly=True),
+ 'module_name': fields.char('Module Name', size=128),
+ }
+
+ _defaults = {
+ 'state': 'init',
}
def importzip(self, cr, uid, ids, context):
- module_obj= self.pool.get('ir.module.module')
- active_ids = context and context.get('active_ids', False)
- data = self.browse(cr, uid, ids , context=context)[0]
+ (data,) = self.browse(cr, uid, ids , context=context)
module_data = data.module_file
- val =base64.decodestring(module_data)
+ val = base64.decodestring(module_data)
fp = StringIO()
fp.write(val)
fdata = zipfile.ZipFile(fp, 'r')
@@ -55,62 +58,30 @@ class base_module_import(osv.osv_memory):
ad = tools.config['addons_path']
- fname = os.path.join(ad,module_name+'.zip')
+ fname = os.path.join(ad, module_name+'.zip')
try:
fp = file(fname, 'wb')
fp.write(val)
fp.close()
- except IOError, e:
+ except IOError:
raise osv.except_osv(_('Error !'), _('Can not create the module file: %s !') % (fname,) )
- module_obj.update_list(cr, uid,{'module_name': module_name,})
- data_obj = self.pool.get('ir.model.data')
- id2 = data_obj._get_id(cr, uid, 'base', 'view_base_module_import_msg')
- if id2:
- id2 = data_obj.browse(cr, uid, id2, context=context).res_id
-
- module_name = module_obj.browse(cr, uid, ids, context=context)
- return {
- 'domain': str([('name', '=', module_name)]),
- 'name': 'Message',
- 'view_type': 'form',
- 'view_mode': 'form',
- 'res_model': 'base.module.import.msg',
- 'views': [(id2, 'form')],
- 'view_id': False,
- 'type': 'ir.actions.act_window',
- 'target': 'new',
- }
-
-base_module_import()
-
-class base_module_import_msg(osv.osv_memory):
- """ message """
- _name = "base.module.import.msg"
- _description = "Message"
+ self.pool.get('ir.module.module').update_list(cr, uid, {'module_name': module_name,})
+ self.write(cr, uid, ids, {'state':'done', 'module_name': module_name}, context)
+ return False
def action_module_open(self, cr, uid, ids, context):
- module_obj = self.pool.get('base.module.import')
- data = module_obj.browse(cr, uid, ids , context=context)[0]
- module_data = data.module_file
-
- val =base64.decodestring(module_data)
- fp = StringIO()
- fp.write(val)
- fdata = zipfile.ZipFile(fp, 'r')
- fname = fdata.namelist()[0]
- module_name = os.path.split(fname)[0]
-
+ (data,) = self.browse(cr, uid, ids , context=context)
return {
- 'domain': str([('name', '=', module_name)]),
- 'name': 'Module List',
+ 'domain': str([('name', '=', data.module_name)]),
+ 'name': 'Modules',
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'ir.module.module',
'type': 'ir.actions.act_window',
}
-base_module_import_msg()
+base_module_import()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file
diff --git a/bin/addons/base/module/wizard/base_module_import_view.xml b/bin/addons/base/module/wizard/base_module_import_view.xml
index 8cb974167d9..b04bc050e97 100644
--- a/bin/addons/base/module/wizard/base_module_import_view.xml
+++ b/bin/addons/base/module/wizard/base_module_import_view.xml
@@ -7,17 +7,41 @@
<field name="model">base.module.import</field>
<field name="type">form</field>
<field name="arch" type="xml">
- <form string="Module import">
- <separator string="Module Import" colspan="4"/>
- <label string="Please give your module .ZIP file to import." colspan="4"/>
- <field name="module_file"/>
- <separator string="" colspan="4" />
- <newline/>
- <group colspan="6" >
- <button special="cancel" string="Cancel" icon="gtk-cancel"/>
- <button name="importzip" string="Import module" type="object" icon="gtk-ok"/>
- </group>
- </form>
+ <form string="Import module">
+ <group col="8">
+ <group colspan="3">
+ <field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
+ <newline/>
+ <label colspan="4" width="220" string="This wizard helps you add a new language to you OpenERP system. After loading a new language it becomes available as default interface language for users and partners."/>
+ <label colspan="4" width="220"/>
+ <label colspan="4" width="220" string="Please be patient, this operation may take a few minutes (depending on the number of modules currently installed)..."/>
+ <field name="state" invisible="1"/>
+ </group>
+ <separator orientation="vertical" rowspan="15"/>
+ <group colspan="4">
+ <separator string="Module Import" colspan="4"/>
+ <group states="init" colspan="4" col="4">
+ <label string="Select module package to import (.zip file):" colspan="4"/>
+ <field name="module_file" colspan="4"/>
+ </group>
+ <group states="done" colspan="4" col="4">
+ <label string="Module file successfully imported!" colspan="4"/>
+ </group>
+ </group>
+ <group colspan="8" col="8" states="init">
+ <separator string="" colspan="8"/>
+ <label colspan="6" width="220"/>
+ <button special="cancel" string="Cancel" icon="gtk-cancel"/>
+ <button name="importzip" string="Import module" type="object" icon="gtk-apply"/>
+ </group>
+ <group colspan="8" col="8" states="done">
+ <separator string="" colspan="8"/>
+ <label colspan="6" width="220"/>
+ <button special="cancel" string="Close" icon="gtk-ok"/>
+ <button name="action_module_open" string="Open Modules" type="object" icon="gtk-go-forward"/>
+ </group>
+ </group>
+ </form>
</field>
</record>
@@ -31,36 +55,12 @@
</record>
<menuitem
- name="Import Module"
- action="action_view_base_module_import"
- id="menu_view_base_module_import"
- parent="menu_management"
- sequence="1"/>
+ name="Import Module"
+ action="action_view_base_module_import"
+ id="menu_view_base_module_import"
+ parent="menu_management"
+ sequence="1"/>
- <record id="view_base_module_import_msg" model="ir.ui.view">
- <field name="name">Module Import Message</field>
- <field name="model">base.module.import.msg</field>
- <field name="type">form</field>
- <field name="arch" type="xml">
- <form string="Message">
- <label string="Module successfully imported !"/>
- <separator string="" colspan="4"/>
- <newline/>
- <group>
- <button name="action_module_open" string="Cancel" type="object" icon="gtk-cancel"/>
- </group>
- </form>
- </field>
- </record>
-
- <record id="action_view_base_module_import_msg" model="ir.actions.act_window">
- <field name="name">Module Import Message</field>
- <field name="res_model">base.module.import.msg</field>
- <field name="view_type">form</field>
- <field name="view_mode">form</field>
- <field name="view_id" ref="view_base_module_import"/>
- <field name="target">new</field>
- </record>
</data>
</openerp>
diff --git a/bin/addons/base/module/wizard/base_module_scan.py b/bin/addons/base/module/wizard/base_module_scan.py
index cd8d4ab7ec5..d47e091955f 100644
--- a/bin/addons/base/module/wizard/base_module_scan.py
+++ b/bin/addons/base/module/wizard/base_module_scan.py
@@ -19,16 +19,13 @@
#
##############################################################################
import os
-import re
import glob
-import time
import imp
import tools
-import pooler
import zipfile
-from osv import osv, fields
+from osv import osv
class base_module_scan(osv.osv_memory):
""" scan module """
diff --git a/bin/addons/base/module/wizard/base_module_update.py b/bin/addons/base/module/wizard/base_module_update.py
index 29e897b3a0c..a0d21840d90 100644
--- a/bin/addons/base/module/wizard/base_module_update.py
+++ b/bin/addons/base/module/wizard/base_module_update.py
@@ -18,8 +18,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-import netsvc
-import pooler
from osv import osv, fields
class base_module_update(osv.osv_memory):
@@ -27,85 +25,37 @@ class base_module_update(osv.osv_memory):
_name = "base.module.update"
_description = "Update Module"
+ _inherit = "ir.wizard.screen"
- def update_module(self, cr, uid, ids, context):
- """
- Update Module
-
- @param cr: the current row, from the database cursor.
- @param uid: the current user’s ID for security checks.
- @param ids: the ID or list of IDs
- @param context: A standard dictionary
- """
- data_obj = self.pool.get('ir.model.data')
- id2 = data_obj._get_id(cr, uid, 'base', 'view_base_module_update_open')
- if id2:
- id2 = data_obj.browse(cr, uid, id2, context=context).res_id
-
- return {
- 'view_type': 'form',
- 'view_mode': 'form',
- 'res_model': 'base.module.update.open',
- 'views': [(id2, 'form')],
- 'view_id': False,
- 'type': 'ir.actions.act_window',
- 'target': 'new',
-
- }
-
-base_module_update()
-
-class base_module_update_open(osv.osv_memory):
- """ Update Module Open """
-
- _name = "base.module.update.open"
- _description = "Update Module Open"
+ _columns = {
+ 'update': fields.integer('Number of modules updated', readonly=True),
+ 'add': fields.integer('Number of modules added', readonly=True),
+ 'state':fields.selection([('init','init'),('done','done')], 'state', readonly=True),
+ }
- def default_get(self, cr, uid, fields, context=None):
- """
- This function gets default values
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param fields: List of fields for default value
- @param context: A standard dictionary for contextual values
- @return : default values of fields.
- """
+ _defaults = {
+ 'state': 'init',
+ }
+ def update_module(self, cr, uid, ids, context=None):
module_obj = self.pool.get('ir.module.module')
update, add = module_obj.update_list(cr, uid,)
- return {'update': update, 'add': add}
-
- _columns = {
- 'update': fields.integer('Number of modules updated', readonly=True),
- 'add': fields.integer('Number of modules added', readonly=True),
- }
+ self.write(cr, uid, ids, {'update': update, 'add': add, 'state': 'done'}, context=context)
+ return False
def action_module_open(self, cr, uid, ids, context):
- """
- Update Module List Open
-
- @param cr: the current row, from the database cursor.
- @param uid: the current user’s ID for security checks.
- @param ids: the ID or list of IDs
- @param context: A standard dictionary
- """
res = {
'domain': str([]),
- 'name': 'Module List',
+ 'name': 'Modules',
'view_type': 'form',
'view_mode': 'tree,form',
'res_model': 'ir.module.module',
'view_id': False,
'type': 'ir.actions.act_window',
}
- view_obj = self.pool.get('ir.ui.view')
- search_view_id = view_obj.search(cr, uid, [('name','=','ir.module.module.list.select')], context=context)
- if search_view_id:
- res.update({'search_view_id' : search_view_id[0]})
return res
-base_module_update_open()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+base_module_update()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file
diff --git a/bin/addons/base/module/wizard/base_module_update_view.xml b/bin/addons/base/module/wizard/base_module_update_view.xml
index 08576006ba5..21bff3fb935 100644
--- a/bin/addons/base/module/wizard/base_module_update_view.xml
+++ b/bin/addons/base/module/wizard/base_module_update_view.xml
@@ -7,15 +7,41 @@
<field name="model">base.module.update</field>
<field name="type">form</field>
<field name="arch" type="xml">
- <form string="Scan for new modules">
- <label string="This function will check for new modules in the 'addons' path" colspan="4" align="0.0"/>
- <separator string="" colspan="4" />
- <newline/>
- <group colspan="6" >
- <button special="cancel" string="Cancel" icon="gtk-cancel"/>
- <button name="update_module" string="Check new modules" type="object" icon="gtk-ok"/>
- </group>
- </form>
+ <form string="Update Module List">
+ <group col="8">
+ <group colspan="3">
+ <field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
+ <newline/>
+ <label colspan="4" width="220" string="This wizard will scan all module repositories on the server side to detect newly added modules as well as any change to existing modules."/>
+ <label colspan="4" width="220"/>
+ <label colspan="4" width="220" string="Please be patient, as this operation may take a few seconds..."/>
+ <field name="state" invisible="1"/>
+ </group>
+ <separator orientation="vertical" rowspan="15"/>
+ <group colspan="4">
+ <separator string="Module update result" colspan="4"/>
+ <group states="init" colspan="4">
+ <label string="Click on Update below to start the process..." colspan="4"/>
+ </group>
+ <group states="done" colspan="4">
+ <field name="update" colspan="4"/>
+ <field name="add" colspan="4"/>
+ </group>
+ </group>
+ <group colspan="8" col="8" states="init">
+ <separator string="" colspan="8"/>
+ <label colspan="6" width="220"/>
+ <button special="cancel" string="Cancel" icon="gtk-cancel"/>
+ <button name="update_module" string="Update" type="object" icon="gtk-ok"/>
+ </group>
+ <group colspan="8" col="8" states="done">
+ <separator string="" colspan="8"/>
+ <label colspan="6" width="220"/>
+ <button special="cancel" string="Close" icon="gtk-ok"/>
+ <button name="action_module_open" string="Open Modules" type="object" icon="gtk-go-forward"/>
+ </group>
+ </group>
+ </form>
</field>
</record>
@@ -36,33 +62,5 @@
sequence="2"
icon="STOCK_CONVERT"/>
- <record id="view_base_module_update_open" model="ir.ui.view">
- <field name="name">Update ModuleList</field>
- <field name="model">base.module.update.open</field>
- <field name="type">form</field>
- <field name="arch" type="xml">
- <form string="New modules">
- <field name="update" colspan="4"/>
- <field name="add" colspan="4"/>
- <separator string="" colspan="4" />
- <newline/>
- <group colspan="6" >
- <button special="cancel" string="Cancel" icon="gtk-cancel"/>
- <button name="action_module_open" string="OK" type="object" icon="gtk-ok"/>
- </group>
- </form>
- </field>
- </record>
-
- <record id="action_view_base_module_update_open" model="ir.actions.act_window">
- <field name="name">Update ModuleList</field>
- <field name="type">ir.actions.act_window</field>
- <field name="res_model">base.module.update.open</field>
- <field name="view_type">form</field>
- <field name="view_mode">form</field>
- <field name="view_id" ref="view_base_module_update"/>
- <field name="target">new</field>
- </record>
-
</data>
</openerp> \ No newline at end of file
diff --git a/bin/addons/base/module/wizard/base_module_upgrade.py b/bin/addons/base/module/wizard/base_module_upgrade.py
index 500622489e7..4db4028bdb0 100644
--- a/bin/addons/base/module/wizard/base_module_upgrade.py
+++ b/bin/addons/base/module/wizard/base_module_upgrade.py
@@ -20,8 +20,6 @@
##############################################################################
import pooler
-import os
-import tools
from osv import osv, fields
class base_module_upgrade(osv.osv_memory):
@@ -39,7 +37,7 @@ class base_module_upgrade(osv.osv_memory):
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param context: A standard dictionary
+ @param context: A standard dictionary
@return: New arch of view.
"""
res = super(base_module_upgrade, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
@@ -50,7 +48,7 @@ class base_module_upgrade(osv.osv_memory):
ids = self.get_module_list(cr, uid, context=context)
if not ids:
- res['arch'] = '''<form string="System update done">
+ res['arch'] = '''<form string="Apply Scheduled Upgrades">
<separator string="System update completed" colspan="4"/>
<label align="0.0" string="The selected modules have been updated / installed !" colspan="4"/>
<label align="0.0" string="We suggest to reload the menu tab to see the new menus (Ctrl+T then Ctrl+R)." colspan="4"/>
@@ -98,7 +96,7 @@ class base_module_upgrade(osv.osv_memory):
raise osv.except_osv('Unmet dependency !', 'Following modules are uninstalled or unknown. \n\n'+'\n'.join(unmet_packages))
mod_obj.download(cr, uid, ids, context=context)
cr.commit()
- db, pool = pooler.restart_pool(cr.dbname, update_module=True)
+ _, pool = pooler.restart_pool(cr.dbname, update_module=True)
id2 = data_obj._get_id(cr, uid, 'base', 'view_base_module_upgrade_install')
if id2:
diff --git a/bin/addons/base/module/wizard/base_module_upgrade_view.xml b/bin/addons/base/module/wizard/base_module_upgrade_view.xml
index ce7d2e6b659..75e635b3ab4 100644
--- a/bin/addons/base/module/wizard/base_module_upgrade_view.xml
+++ b/bin/addons/base/module/wizard/base_module_upgrade_view.xml
@@ -47,7 +47,7 @@
<field name="model">base.module.upgrade</field>
<field name="type">form</field>
<field name="arch" type="xml">
- <form string="System update done">
+ <form string="Apply Scheduled Upgrades">
<separator string="System update completed" colspan="4"/>
<label align="0.0" string="The selected modules have been updated / installed !" colspan="4"/>
<label align="0.0" string="We suggest to reload the menu tab to see the new menus (Ctrl+T then Ctrl+R)." colspan="4"/>
diff --git a/bin/addons/base/module/wizard/base_update_translations.py b/bin/addons/base/module/wizard/base_update_translations.py
index 7e61c0a2431..94cb0ee2e18 100644
--- a/bin/addons/base/module/wizard/base_update_translations.py
+++ b/bin/addons/base/module/wizard/base_update_translations.py
@@ -35,7 +35,7 @@ class base_update_translations(osv.osv_memory):
lang_obj=pooler.get_pool(cr.dbname).get('res.lang')
ids=lang_obj.search(cr, uid, [('code', '=', lang_code)])
if not ids:
- raise osv.orm_except('Bad lang')
+ raise osv.except_osv(_('No language with code "%s" exists') % lang_code)
lang = lang_obj.browse(cr, uid, ids[0])
return lang.name
def act_cancel(self, cr, uid, ids, context=None):
@@ -50,9 +50,18 @@ class base_update_translations(osv.osv_memory):
buf.close()
return {'type': 'ir.actions.act_window_close'}
+ def default_get(self, cr, uid, fields, context=None):
+ res = super(base_update_translations, self).default_get(cr, uid, fields, context=context)
+ record_id = context and context.get('active_id', False) or False
+ if record_id:
+ lang = self.pool.get('res.lang').browse(cr, uid, record_id).code
+ res.update(lang=lang)
+ return res
+
_name = 'base.update.translations'
+ _inherit = "ir.wizard.screen"
_columns = {
'lang': fields.selection(_get_languages, 'Language', required=True),
}
-base_update_translations()
+base_update_translations() \ No newline at end of file
diff --git a/bin/addons/base/module/wizard/base_update_translations_view.xml b/bin/addons/base/module/wizard/base_update_translations_view.xml
index 781f3d142d8..60d30440ca1 100644
--- a/bin/addons/base/module/wizard/base_update_translations_view.xml
+++ b/bin/addons/base/module/wizard/base_update_translations_view.xml
@@ -2,23 +2,34 @@
<openerp>
<data>
<record id="wizard_update_translations" model="ir.ui.view">
- <field name="name">Update Translations</field>
+ <field name="name">Synchronize Translations</field>
<field name="model">base.update.translations</field>
<field name="type">form</field>
<field name="arch" type="xml">
- <form col="3" string="Update Translations">
- <field name="lang"/>
- <label align="0.0" colspan="4" string="This wizard will detect new terms in the application so that you can update them manually."/>
- <separator colspan="4"/>
- <group col="2" colspan="4" fill="0">
- <button icon="gtk-cancel" name="act_cancel" special="cancel" string="Cancel" type="object"/>
- <button icon="gtk-ok" name="act_update" string="Update" type="object"/>
+ <form string="Synchronize Translations">
+ <group col="8">
+ <group colspan="3">
+ <field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
+ <newline/>
+ <label colspan="4" width="220" string="This wizard will detect new terms to translate in the application, so that you can then add translations manually or perform a complete export (as a template for a new language example)."/>
+ </group>
+ <separator orientation="vertical" rowspan="15"/>
+ <group colspan="4">
+ <separator string="Synchronize Translation" colspan="4"/>
+ <field name="lang" colspan="4"/>
+ </group>
+ <group colspan="8" col="8">
+ <separator string="" colspan="8"/>
+ <label colspan="6" width="220"/>
+ <button icon="gtk-cancel" name="act_cancel" special="cancel" string="Cancel" type="object"/>
+ <button icon="gtk-ok" name="act_update" string="Update" type="object"/>
+ </group>
</group>
</form>
</field>
</record>
<record id="action_wizard_update_translations" model="ir.actions.act_window">
- <field name="name">Resynchronise Terms</field>
+ <field name="name">Synchronize Translations</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">base.update.translations</field>
<field name="view_type">form</field>