From ccfb3bd4d178b56ea65b59a42d7e47b910b072a9 Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Mon, 29 Mar 2010 11:14:25 +0530 Subject: [PATCH] [ADD] mrp: Added remaining wizard after converting to osv_memory wizard (Compute Procurement). bzr revid: uco@tinyerp.co.in-20100329054425-lzfhfk05cvq4y6oq --- addons/mrp/__terp__.py | 1 + addons/mrp/wizard/__init__.py | 2 +- addons/mrp/wizard/mrp_procurement.py | 45 +++++++++++++++ addons/mrp/wizard/mrp_procurement_view.xml | 34 ++++++++++++ addons/mrp/wizard/wizard_procurement.py | 64 ---------------------- 5 files changed, 81 insertions(+), 65 deletions(-) create mode 100644 addons/mrp/wizard/mrp_procurement.py create mode 100644 addons/mrp/wizard/mrp_procurement_view.xml delete mode 100644 addons/mrp/wizard/wizard_procurement.py 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 + +
+