diff --git a/addons/auction/__terp__.py b/addons/auction/__terp__.py index c3f9058f070..41c4a6f1a8d 100644 --- a/addons/auction/__terp__.py +++ b/addons/auction/__terp__.py @@ -43,6 +43,7 @@ 'wizard/auction_pay_buy_view.xml', 'wizard/auction_payer_sel_view.xml', 'wizard/auction_lots_sms_send_view.xml', + 'wizard/auction_catalog_flagey_view.xml', 'auction_view.xml', 'auction_report.xml', diff --git a/addons/auction/wizard/__init__.py b/addons/auction/wizard/__init__.py index eba1b0b5113..e6748e31172 100644 --- a/addons/auction/wizard/__init__.py +++ b/addons/auction/wizard/__init__.py @@ -28,6 +28,7 @@ import auction_lots_auction_move import auction_pay_buy import auction_payer_sel import auction_lots_sms_send +import auction_catalog_flagey_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/auction/wizard/auction_catalog_flagey.py b/addons/auction/wizard/auction_catalog_flagey.py deleted file mode 100644 index fd73e7dadc4..00000000000 --- a/addons/auction/wizard/auction_catalog_flagey.py +++ /dev/null @@ -1,49 +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 netsvc -import pooler - -def _wo_check(self, cr, uid, data, context): - pool = pooler.get_pool(cr.dbname) - current_auction=pool.get('auction.dates').browse(cr,uid,data['id']) - v_lots=pool.get('auction.lots').search(cr,uid,[('auction_id','=',current_auction.id)]) - v_ids=pool.get('auction.lots').browse(cr,uid,v_lots) - for ab in v_ids: - if not ab.auction_id : - raise wizard.except_wizard('Error!','No Lots belong to this Auction Date') - return 'report' - -class wizard_report(wizard.interface): - states = { - 'init': { - 'actions': [], - 'result' : {'type': 'choice', 'next_state': _wo_check } - }, - 'report': { - 'actions': [], - 'result': {'type':'print', 'report':'auction.cat_flagy', 'state':'end'} - } - } -wizard_report('auction.catalog.flagey') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/auction/wizard/auction_catalog_flagey_report.py b/addons/auction/wizard/auction_catalog_flagey_report.py new file mode 100644 index 00000000000..4babf667a70 --- /dev/null +++ b/addons/auction/wizard/auction_catalog_flagey_report.py @@ -0,0 +1,53 @@ +# -*- 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, fields +import netsvc + +class auction_catalog_flagey(osv.osv_memory): + _name = 'auction.catalog.flagey' + _description = 'Auction Catalog Flagey' + + def default_get(self, cr, uid, fields, context): + res = super(auction_catalog_flagey, self).default_get(cr, uid, fields, context=context) + return res + + def view_init(self, cr, uid, fields_list, context): + current_auction = self.pool.get('auction.dates').browse(cr,uid,context.get('active_ids', [])) + v_lots = self.pool.get('auction.lots').search(cr,uid,[('auction_id','=',current_auction.id)]) + v_ids = self.pool.get('auction.lots').browse(cr,uid,v_lots) + for ab in v_ids: + if not ab.auction_id : + raise osv.except_osv('Error!','No Lots belong to this Auction Date') + pass + + def print_report(self, cr, uid, ids, context): + datas = {'ids': context.get('active_ids',[])} + return { + 'type': 'ir.actions.report.xml', + 'report_name': 'auction.cat_flagy', + 'datas': datas, + } + +auction_catalog_flagey() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/auction/wizard/auction_catalog_flagey_view.xml b/addons/auction/wizard/auction_catalog_flagey_view.xml new file mode 100644 index 00000000000..ca87771cc37 --- /dev/null +++ b/addons/auction/wizard/auction_catalog_flagey_view.xml @@ -0,0 +1,32 @@ + + + + + + + + Auction Catalog Flagey + auction.catalog.flagey + form + +
+