From d596d0f1a40ae60f2866b334b0539cc459c8a45f Mon Sep 17 00:00:00 2001 From: mso Date: Mon, 29 Mar 2010 12:53:02 +0530 Subject: [PATCH] [IMP] auction: wizard_lots_cancel has been converted into osv_memory bzr revid: mso@mso-20100329072302-sjhgr93nc25yk0zw --- addons/auction/wizard/auction_lots_cancel.py | 57 ++++++++++++ .../wizard/auction_lots_cancel_view.xml | 21 +++++ addons/auction/wizard/wizard_lots_cancel.py | 91 ------------------- addons/mrp/product.py | 61 +++++++------ 4 files changed, 112 insertions(+), 118 deletions(-) create mode 100644 addons/auction/wizard/auction_lots_cancel.py create mode 100644 addons/auction/wizard/auction_lots_cancel_view.xml delete mode 100644 addons/auction/wizard/wizard_lots_cancel.py diff --git a/addons/auction/wizard/auction_lots_cancel.py b/addons/auction/wizard/auction_lots_cancel.py new file mode 100644 index 00000000000..91f38a364e0 --- /dev/null +++ b/addons/auction/wizard/auction_lots_cancel.py @@ -0,0 +1,57 @@ +# -*- 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 osv +from osv import fields + +class auction_lots_cancel(osv.osv): + ''' + Open ERP Model + ''' + _name = 'auction.lots.cancel' + _description = 'To cancel auction lots.' + + def _cancel(self, cr, uid, ids, context): + """ + To cancel the auction lot + + @param self: The object pointer. + @param cr: A database cursor + @param uid: ID of the user currently logged in + @param ids: List of IDs selected + @param context: A standard dictionary + @return: + """ + + lots_obj = self.pool.get('auction.lots') + invoice_obj = self.pool.get('account.invoice') + lot = lots_obj.browse(cr,uid,context['active_id'],context) + if lot.ach_inv_id: + p = invoice_obj.refund(['lot.ach_inv_id.id'],context) + if lot.vnd_inv_id: + p = invoice_obj.refund(['lot.vnd_inv_id.id'],context) + return {} + + _columns = { + + + } +auction_lots_cancel() \ No newline at end of file diff --git a/addons/auction/wizard/auction_lots_cancel_view.xml b/addons/auction/wizard/auction_lots_cancel_view.xml new file mode 100644 index 00000000000..e80222b1e71 --- /dev/null +++ b/addons/auction/wizard/auction_lots_cancel_view.xml @@ -0,0 +1,21 @@ + + + + + auction.lots.cancel.form + auction.lots.cancel + form + +
+