diff --git a/addons/mrp/__terp__.py b/addons/mrp/__terp__.py index a147266ce1d..9f5bc664be7 100644 --- a/addons/mrp/__terp__.py +++ b/addons/mrp/__terp__.py @@ -62,6 +62,7 @@ 'mrp_data.xml', 'mrp_wizard_view.xml', 'mrp_view.xml', + 'wizard/make_procurement_view.xml', 'mrp_wizard.xml', 'mrp_report.xml', 'company_view.xml', diff --git a/addons/mrp/mrp_wizard.xml b/addons/mrp/mrp_wizard.xml index 74001494c77..e1823092989 100644 --- a/addons/mrp/mrp_wizard.xml +++ b/addons/mrp/mrp_wizard.xml @@ -24,12 +24,12 @@ - + + + + + + diff --git a/addons/mrp/wizard/__init__.py b/addons/mrp/wizard/__init__.py index 240f25daa9d..a859d55b44e 100644 --- a/addons/mrp/wizard/__init__.py +++ b/addons/mrp/wizard/__init__.py @@ -26,7 +26,7 @@ import wizard_price import wizard_workcenter_load import wizard_track_prod import wizard_change_production_qty -import make_procurement +import make_procurement_product # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp/wizard/make_procurement.py b/addons/mrp/wizard/make_procurement.py deleted file mode 100644 index 0cf12107181..00000000000 --- a/addons/mrp/wizard/make_procurement.py +++ /dev/null @@ -1,102 +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 . -# -############################################################################## - -import wizard -import pooler -import netsvc - -import time - -def _get_default(obj, cr, uid, data, context=None): - pool = pooler.get_pool(cr.dbname) - product = pool.get('product.product').browse(cr, uid, data['id'], context) - return {'product_id': product.id, 'uom_id':product.uom_id.id, 'qty':1.0} - -def make_procurement(obj, cr, uid, data, context=None): - '''Create procurement''' - pool = pooler.get_pool(cr.dbname) - wh = pool.get('stock.warehouse').browse(cr, uid, data['form']['warehouse_id'], context) - user = pool.get('res.users').browse(cr, uid, uid, context) - procure_id = pool.get('mrp.procurement').create(cr, uid, { - 'name':'INT:'+str(user.login), - 'date_planned':data['form']['date_planned'], - 'product_id':data['form']['product_id'], - 'product_qty':data['form']['qty'], - 'product_uom':data['form']['uom_id'], - 'location_id':wh.lot_stock_id.id, - 'procure_method':'make_to_order', - }, context=context) - wf_service = netsvc.LocalService("workflow") - wf_service.trg_validate(uid, 'mrp.procurement', procure_id, 'button_confirm', cr) - return {} - - -class MakeProcurement(wizard.interface): - '''Wizard that create a procurement from a product form''' - - done_form = """ -
-