diff --git a/addons/mrp/__terp__.py b/addons/mrp/__terp__.py index acf25b160e0..10fadb00bc6 100644 --- a/addons/mrp/__terp__.py +++ b/addons/mrp/__terp__.py @@ -62,6 +62,7 @@ 'mrp_data.xml', 'wizard/mrp_product_produce_view.xml', 'wizard/make_procurement_view.xml', + 'wizard/mrp_procurement_view.xml', 'wizard/change_production_qty_view.xml', 'wizard/orderpoint_procurement_view.xml', 'wizard/mrp_price_view.xml', diff --git a/addons/mrp/wizard/__init__.py b/addons/mrp/wizard/__init__.py index 043cdc94465..012677a9ca0 100644 --- a/addons/mrp/wizard/__init__.py +++ b/addons/mrp/wizard/__init__.py @@ -21,7 +21,7 @@ import mrp_product_produce import orderpoint_procurement -import wizard_procurement +import mrp_procurement import schedulers_all import mrp_price import mrp_workcenter_load diff --git a/addons/mrp/wizard/mrp_procurement.py b/addons/mrp/wizard/mrp_procurement.py new file mode 100644 index 00000000000..77728c05517 --- /dev/null +++ b/addons/mrp/wizard/mrp_procurement.py @@ -0,0 +1,45 @@ +# -*- 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 threading +from osv import osv, fields + +class procurement_compute(osv.osv_memory): + _name = 'mrp.procurement.compute' + _description = 'Compute Procurement' + + def _procure_calculation_procure(self, cr, uid, ids, context): + try: + proc_obj = self.pool.get('mrp.procurement') + proc_obj._procure_confirm(cr, uid, use_new_cursor=cr.dbname, context=context) + finally: + cr.close() + return {} + + def procure_calculation(self, cr, uid, ids, context): + threaded_calculation = threading.Thread(target=self._procure_calculation_procure, args=(cr, uid, ids, context)) + threaded_calculation.start() + return {} + +procurement_compute() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/mrp/wizard/mrp_procurement_view.xml b/addons/mrp/wizard/mrp_procurement_view.xml new file mode 100644 index 00000000000..6d78f89793d --- /dev/null +++ b/addons/mrp/wizard/mrp_procurement_view.xml @@ -0,0 +1,34 @@ + + + + + + + + Compute Procurements + mrp.procurement.compute + form + +
+