From 514ab7423adabe8060d74ddb9a33b9eb3665ec95 Mon Sep 17 00:00:00 2001 From: mtr Date: Fri, 23 Apr 2010 19:20:17 +0530 Subject: [PATCH 01/82] [IMP] stock: Task ID-581: Converted stock_ups and stock_replacement wizards into osv_memory wizards. bzr revid: mtr@mtr-20100423135017-bg5iuwdyodj1dbao --- addons/stock/wizard/__init__.py | 4 +- addons/stock/wizard/stock_replacement.py | 68 ++++++++++++++ .../stock/wizard/stock_replacement_view.xml | 41 +++++++++ addons/stock/wizard/stock_ups.py | 91 +++++++++++++++++++ addons/stock/wizard/stock_ups_view.xml | 56 ++++++++++++ addons/stock/wizard/wizard_replacement.py | 60 ------------ addons/stock/wizard/wizard_ups.py | 85 ----------------- 7 files changed, 258 insertions(+), 147 deletions(-) create mode 100644 addons/stock/wizard/stock_replacement.py create mode 100644 addons/stock/wizard/stock_replacement_view.xml create mode 100644 addons/stock/wizard/stock_ups.py create mode 100644 addons/stock/wizard/stock_ups_view.xml delete mode 100644 addons/stock/wizard/wizard_replacement.py delete mode 100644 addons/stock/wizard/wizard_ups.py diff --git a/addons/stock/wizard/__init__.py b/addons/stock/wizard/__init__.py index 8fac3041fb3..82825000eaa 100644 --- a/addons/stock/wizard/__init__.py +++ b/addons/stock/wizard/__init__.py @@ -23,8 +23,8 @@ import stock_traceability import stock_move import stock_partial_picking import stock_partial_move -import wizard_replacement -import wizard_ups +import stock_replacement +import stock_ups import stock_inventory_merge import stock_inventory_set_stock_zero import stock_fill_inventory diff --git a/addons/stock/wizard/stock_replacement.py b/addons/stock/wizard/stock_replacement.py new file mode 100644 index 00000000000..e753206ec34 --- /dev/null +++ b/addons/stock/wizard/stock_replacement.py @@ -0,0 +1,68 @@ +# -*- 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 +from service import web_services +from tools.translate import _ +import netsvc +import pooler +import time +import wizard + +class stock_replacement(osv.osv_memory): + """ + This class has been defined for replacement wizard + """ + _name = "stock.replacement" + _description = "Stock Replacement" + + def get_composant(self, cr, uid, ids, context): + return {} + + def replace_composant(self, cr, uid, ids, context): + """ + to open a new wizard that acknowledge, a replacement task + + @return: it returns the replacement acknowledgement form + + """ + return { + 'name': False, + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'stock.replacement.result', + 'type': 'ir.actions.act_window', + 'target':'new', + } + +stock_replacement() + +class stock_replacement_result(osv.osv_memory): + """ + This class has been defined for replacement result + """ + _name = "stock.replacement.result" + _description = "Stock Replacement result" + +stock_replacement_result() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/stock/wizard/stock_replacement_view.xml b/addons/stock/wizard/stock_replacement_view.xml new file mode 100644 index 00000000000..ce5f7efbc9f --- /dev/null +++ b/addons/stock/wizard/stock_replacement_view.xml @@ -0,0 +1,41 @@ + + + + + Stock Replacement + stock.replacement + form + +
+