From ad211158355cf3b861511f8f81bfcde69955f618 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Thu, 7 Apr 2011 11:21:47 +0530 Subject: [PATCH] [IMP]Product:Optimize Code of Wiz bzr revid: aag@tinyerp.co.in-20110407055147-knj8p33livb9dg23 --- addons/product/__openerp__.py | 2 +- addons/product/wizard/__init__.py | 1 - addons/product/wizard/product_installer.xml | 23 +++++++ .../product/wizard/res_product_installer.py | 54 ---------------- .../product/wizard/res_product_installer.xml | 63 ------------------- 5 files changed, 24 insertions(+), 119 deletions(-) create mode 100644 addons/product/wizard/product_installer.xml delete mode 100644 addons/product/wizard/res_product_installer.py delete mode 100644 addons/product/wizard/res_product_installer.xml diff --git a/addons/product/__openerp__.py b/addons/product/__openerp__.py index 5ce1730c8c5..bcddcc93bdf 100644 --- a/addons/product/__openerp__.py +++ b/addons/product/__openerp__.py @@ -55,7 +55,7 @@ Print product labels with barcode. 'product_data.xml', 'product_report.xml', 'product_view.xml', - 'wizard/res_product_installer.xml', + 'wizard/product_installer.xml', 'product_shortcut_data.xml', 'pricelist_view.xml', 'partner_view.xml', diff --git a/addons/product/wizard/__init__.py b/addons/product/wizard/__init__.py index b18565e932b..47f5f2641fc 100644 --- a/addons/product/wizard/__init__.py +++ b/addons/product/wizard/__init__.py @@ -19,7 +19,6 @@ # ############################################################################## import product_price -import res_product_installer # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/product/wizard/product_installer.xml b/addons/product/wizard/product_installer.xml new file mode 100644 index 00000000000..93113818bb6 --- /dev/null +++ b/addons/product/wizard/product_installer.xml @@ -0,0 +1,23 @@ + + + + + + Create some products + ir.actions.act_window + product.product + form + form + + + + + + + current + never + skip + + + + diff --git a/addons/product/wizard/res_product_installer.py b/addons/product/wizard/res_product_installer.py deleted file mode 100644 index 9aa382ecda8..00000000000 --- a/addons/product/wizard/res_product_installer.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - -from osv import fields, osv -import pooler - -class res_product_installer(osv.osv_memory): - _name = 'res.product.installer' - _inherit = 'res.config' - _columns = { - } - _defaults = { - } - - def execute(self, cr, uid, ids, context=None): - if context is None: - context = {} - data_obj = self.pool.get('ir.model.data') - id2 = data_obj._get_id(cr, uid, 'product', 'product_normal_form_view') - if id2: - id2 = data_obj.browse(cr, uid, id2, context=context).res_id - return { - 'view_type': 'form', - 'view_mode': 'form', - 'res_model': 'product.product', - 'views': [(id2, 'form')], -# 'view_id': False, - 'type': 'ir.actions.act_window', - 'target': 'new', - 'nodestroy':True, - } - -res_product_installer() - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/product/wizard/res_product_installer.xml b/addons/product/wizard/res_product_installer.xml deleted file mode 100644 index a92699bffb4..00000000000 --- a/addons/product/wizard/res_product_installer.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create some products - ir.actions.act_window - product.product - form - form - - - - - - - current - never - skip - - - -