diff --git a/addons/product/__openerp__.py b/addons/product/__openerp__.py index a1ee0d144b5..5ce1730c8c5 100644 --- a/addons/product/__openerp__.py +++ b/addons/product/__openerp__.py @@ -55,6 +55,7 @@ Print product labels with barcode. 'product_data.xml', 'product_report.xml', 'product_view.xml', + 'wizard/res_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 47f5f2641fc..b18565e932b 100644 --- a/addons/product/wizard/__init__.py +++ b/addons/product/wizard/__init__.py @@ -19,6 +19,7 @@ # ############################################################################## import product_price +import res_product_installer # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/product/wizard/res_product_installer.py b/addons/product/wizard/res_product_installer.py new file mode 100644 index 00000000000..9aa382ecda8 --- /dev/null +++ b/addons/product/wizard/res_product_installer.py @@ -0,0 +1,54 @@ +# -*- 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 new file mode 100644 index 00000000000..66cebf9c0a1 --- /dev/null +++ b/addons/product/wizard/res_product_installer.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create some products + ir.actions.act_window + product.product + form + + + + + + + new + on_trigger + + + +