[REM] Remove unused ir.wizard.menu and ir.wizard.screen - internal wizards used for...
authorOlivier Dony <odo@openerp.com>
Fri, 28 Sep 2012 12:22:06 +0000 (14:22 +0200)
committerOlivier Dony <odo@openerp.com>
Fri, 28 Sep 2012 12:22:06 +0000 (14:22 +0200)
bzr revid: odo@openerp.com-20120928122206-iynu3ilsurzecwde

13 files changed:
openerp/addons/base/__openerp__.py
openerp/addons/base/ir/__init__.py
openerp/addons/base/ir/wizard/__init__.py [deleted file]
openerp/addons/base/ir/wizard/wizard_menu.py [deleted file]
openerp/addons/base/ir/wizard/wizard_menu_view.xml [deleted file]
openerp/addons/base/ir/wizard/wizard_screen.py [deleted file]
openerp/addons/base/module/wizard/base_import_language.py
openerp/addons/base/module/wizard/base_language_install.py
openerp/addons/base/module/wizard/base_module_import.py
openerp/addons/base/module/wizard/base_module_update.py
openerp/addons/base/module/wizard/base_update_translations.py
openerp/addons/base/module/wizard/base_update_translations_view.xml
openerp/addons/base/res/res_config.py

index 69552a6..173c6ad 100644 (file)
@@ -42,7 +42,6 @@ The kernel of OpenERP, needed for all installation.
         'res/res_security.xml',
         'res/res_config.xml',
         'data/res.country.state.csv',
-        'ir/wizard/wizard_menu_view.xml',
         'ir/ir.xml',
         'ir/ir_translation_view.xml',
         'ir/ir_filters.xml',
index bc4f3ee..c296042 100644 (file)
@@ -36,7 +36,6 @@ import ir_translation
 import ir_exports
 import workflow
 import ir_rule
-import wizard
 import ir_config_parameter
 import osv_memory_autovacuum
 import ir_mail_server
diff --git a/openerp/addons/base/ir/wizard/__init__.py b/openerp/addons/base/ir/wizard/__init__.py
deleted file mode 100644 (file)
index 3f54955..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#    
-#    OpenERP, Open Source Management Solution
-#    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
-#
-#    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Affero General Public License as
-#    published by the Free Software Foundation, either version 3 of the
-#    License, or (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Affero General Public License for more details.
-#
-#    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.     
-#
-##############################################################################
-import wizard_menu
-import wizard_screen
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/openerp/addons/base/ir/wizard/wizard_menu.py b/openerp/addons/base/ir/wizard/wizard_menu.py
deleted file mode 100644 (file)
index 3b4dc79..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#    
-#    OpenERP, Open Source Management Solution
-#    Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
-#
-#    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Affero General Public License as
-#    published by the Free Software Foundation, either version 3 of the
-#    License, or (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Affero General Public License for more details.
-#
-#    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.     
-#
-##############################################################################
-from osv import fields,osv
-
-class wizard_model_menu(osv.osv_memory):
-    _name = 'wizard.ir.model.menu.create'
-    _columns = {
-        'menu_id': fields.many2one('ir.ui.menu', 'Parent Menu', required=True),
-        'name': fields.char('Menu Name', size=64, required=True),
-    }
-
-    def menu_create(self, cr, uid, ids, context=None):
-        if not context:
-            context = {}
-        model_pool = self.pool.get('ir.model')
-        for menu in self.browse(cr, uid, ids, context):
-            model = model_pool.browse(cr, uid, context.get('model_id'), context=context)
-            val = {
-                'name': menu.name,
-                'res_model': model.model,
-                'view_type': 'form',
-                'view_mode': 'tree,form'
-            }
-            action_id = self.pool.get('ir.actions.act_window').create(cr, uid, val)
-            self.pool.get('ir.ui.menu').create(cr, uid, {
-                'name': menu.name,
-                'parent_id': menu.menu_id.id,
-                'action': 'ir.actions.act_window,%d' % (action_id,),
-                'icon': 'STOCK_INDENT'
-            }, context)
-        return {'type':'ir.actions.act_window_close'}
-wizard_model_menu()
-
-class wizard_model_menu_line(osv.osv_memory):
-    _name = 'wizard.ir.model.menu.create.line'
-    _columns = {
-        'wizard_id': fields.many2one('wizard.ir.model.menu.create','Wizard'),
-        'sequence': fields.integer('Sequence'),
-        'view_type': fields.selection([
-            ('tree','Tree'),
-            ('form','Form'),
-            ('graph','Graph'),
-            ('calendar','Calendar'),
-            ('gantt','Gantt')],'View Type',required=True),
-        'view_id': fields.many2one('ir.ui.view', 'View'),
-    }
-    _defaults = {
-        'view_type': lambda self,cr,uid,ctx: 'tree'
-    }
-wizard_model_menu_line()
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/openerp/addons/base/ir/wizard/wizard_menu_view.xml b/openerp/addons/base/ir/wizard/wizard_menu_view.xml
deleted file mode 100644 (file)
index 7fd32b2..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
-    <data>
-        <record id="view_model_menu_create" model="ir.ui.view">
-            <field name="name">Create Menu</field>
-            <field name="model">wizard.ir.model.menu.create</field>
-            <field name="arch" type="xml">
-                <form string="Create Menu" version="7.0">
-                    <group>
-                        <field name="name"/>
-                        <field name="menu_id" domain="[('parent_id','&lt;&gt;',False)]"/>
-                    </group>
-                    <footer>
-                        <button name="menu_create" string="Create _Menu" type="object" class="oe_highlight"/>
-                        or
-                        <button string="Cancel" class="oe_link" special="cancel" />
-                    </footer>
-                </form>
-            </field>
-        </record>
-        <act_window context="{'model_id': active_id}" id="act_menu_create" name="Create Menu" res_model="wizard.ir.model.menu.create" target="new" view_mode="form"/>
-    </data>
-</openerp>
diff --git a/openerp/addons/base/ir/wizard/wizard_screen.py b/openerp/addons/base/ir/wizard/wizard_screen.py
deleted file mode 100644 (file)
index d413ce0..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#    
-#    Copyright (C) 2010 OpenERP s.a. (<http://www.openerp.com>).
-#
-#    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU Affero General Public License as
-#    published by the Free Software Foundation, either version 3 of the
-#    License, or (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU Affero General Public License for more details.
-#
-#    You should have received a copy of the GNU Affero General Public License
-#    along with this program.  If not, see <http://www.gnu.org/licenses/>.     
-#
-##############################################################################
-import base64
-import os
-import random
-
-import tools
-from osv import fields,osv
-
-# Simple base class for wizards that wish to use random images on the left
-# side of the form.
-class wizard_screen(osv.osv_memory):
-    _name = 'ir.wizard.screen'
-
-    def _get_image(self, cr, uid, context=None):
-        path = os.path.join('base','res','config_pixmaps','%d.png'%random.randrange(1,4))
-        image_file = file_data = tools.file_open(path,'rb')
-        try:
-            file_data = image_file.read()
-            return base64.encodestring(file_data)
-        finally:
-            image_file.close()
-
-    def _get_image_fn(self, cr, uid, ids, name, args, context=None):
-        image = self._get_image(cr, uid, context)
-        return dict.fromkeys(ids, image) # ok to use .fromkeys() as the image is same for all 
-
-    _columns = {
-        'config_logo': fields.function(_get_image_fn, string='Image', type='binary'),
-    }
-
-    _defaults = {
-        'config_logo': _get_image
-    }
-wizard_screen()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index 94b9ae4..6f09dc4 100644 (file)
@@ -29,8 +29,6 @@ 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),
         'code': fields.char('Code (eg:en__US)',size=5 , required=True),
@@ -66,6 +64,5 @@ class base_language_import(osv.osv_memory):
         fileobj.close()
         return {}
 
-base_language_import()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index 1e40f84..ab65159 100644 (file)
@@ -27,9 +27,7 @@ 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', required=True),
         'overwrite': fields.boolean('Overwrite Existing Terms', help="If you check this box, your customized translations will be overwritten and replaced by the official ones."),
@@ -63,6 +61,5 @@ class base_language_install(osv.osv_memory):
             'target': 'new',
             'res_id': ids and ids[0] or False,
         }
-base_language_install()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index 3ef9132..34f22bf 100644 (file)
@@ -34,9 +34,7 @@ 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')],
@@ -88,7 +86,5 @@ class base_module_import(osv.osv_memory):
             'type': 'ir.actions.act_window',
         }
 
-base_module_import()
-
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index a0d2184..0893761 100644 (file)
@@ -25,7 +25,6 @@ class base_module_update(osv.osv_memory):
 
     _name = "base.module.update"
     _description = "Update Module"
-    _inherit = "ir.wizard.screen"
 
     _columns = {
         'update': fields.integer('Number of modules updated', readonly=True),
@@ -55,7 +54,4 @@ class base_module_update(osv.osv_memory):
         }
         return res
 
-
-base_module_update()
-
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
index d24851b..abfbc44 100644 (file)
 
 from osv import osv, fields
 import tools
-import pooler
 import cStringIO
 from tools.translate import _
 
 class base_update_translations(osv.osv_memory):
     def _get_languages(self, cr, uid, context):
-        lang_obj=pooler.get_pool(cr.dbname).get('res.lang')
-        ids=lang_obj.search(cr, uid, ['&', ('active', '=', True), ('translatable', '=', True),])
-        langs=lang_obj.browse(cr, uid, ids)
+        lang_obj = self.pool.get('res.lang')
+        ids = lang_obj.search(cr, uid, ['&', ('active', '=', True), ('translatable', '=', True),])
+        langs = lang_obj.browse(cr, uid, ids)
         return [(lang.code, lang.name) for lang in langs]
 
     def _get_lang_name(self, cr, uid, lang_code):
-        lang_obj=pooler.get_pool(cr.dbname).get('res.lang')
-        ids=lang_obj.search(cr, uid, [('code', '=', lang_code)])
+        lang_obj = self.pool.get('res.lang')
+        ids = lang_obj.search(cr, uid, [('code', '=', lang_code)])
         if not ids:
             raise osv.except_osv(_('Error!'), _('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):
-        return {'type': 'ir.actions.act_window_close'}
 
     def act_update(self, cr, uid, ids, context=None):
         this = self.browse(cr, uid, ids)[0]
         lang_name = self._get_lang_name(cr, uid, this.lang)
-        buf=cStringIO.StringIO()
+        buf = cStringIO.StringIO()
         tools.trans_export(this.lang, ['all'], buf, 'csv', cr)
         tools.trans_load_data(cr, buf, 'csv', this.lang, lang_name=lang_name)
         buf.close()
@@ -66,11 +63,8 @@ class base_update_translations(osv.osv_memory):
         return res
 
     _name = 'base.update.translations'
-    _inherit = "ir.wizard.screen"
     _columns = {
         'lang': fields.selection(_get_languages, 'Language', required=True),
     }
 
-base_update_translations()
-
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
index 4a20ef3..18fd305 100644 (file)
@@ -12,7 +12,7 @@
                     <footer>
                         <button name="act_update" string="Update" type="object" class="oe_highlight"/> 
                         or
-                        <button name="act_cancel" special="cancel" string="Cancel" type="object" class="oe_link"/>
+                        <button special="cancel" string="Cancel" type="object" class="oe_link"/>
                     </footer>
                 </form>
             </field>
index d6b42e9..c24fc11 100644 (file)
@@ -37,7 +37,6 @@ class res_config_configurable(osv.osv_memory):
     their view inherit from the related res_config_view_base view.
     '''
     _name = 'res.config'
-    _inherit = 'ir.wizard.screen'
 
     def _next_action(self, cr, uid, context=None):
         Todos = self.pool['ir.actions.todo']