summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruco (OpenERP) <uco@tinyerp.co.in>2010-03-19 14:38:58 +0530
committeruco (OpenERP) <uco@tinyerp.co.in>2010-03-19 14:38:58 +0530
commitd8975f4afc93be748e8c4d0fc39bd28f3ff2dcf0 (patch)
treee0a6b6390fd4fb179b35f3bae1b8862434aed691
parentbc687bcc0aeb799e309b6b3c8ffdeb9e12591ccf (diff)
[ADD] auction: Added an osv_memory wizard 'Auction Catalog Flagey' on auction.dates object.
bzr revid: uco@tinyerp.co.in-20100319090858-i9rf8s1l1kavqyrb
-rw-r--r--addons/auction/__terp__.py1
-rw-r--r--addons/auction/wizard/__init__.py1
-rw-r--r--addons/auction/wizard/auction_catalog_flagey.py49
-rw-r--r--addons/auction/wizard/auction_catalog_flagey_report.py53
-rw-r--r--addons/auction/wizard/auction_catalog_flagey_view.xml32
5 files changed, 87 insertions, 49 deletions
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 (<http://tiny.be>).
-#
-# 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 <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-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 (<http://tiny.be>).
+#
+# 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 <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <!-- Auction Catalog Flagey Report -->
+
+ <record id="view_auction_catalog_flagey_wizard" model="ir.ui.view">
+ <field name="name">Auction Catalog Flagey</field>
+ <field name="model">auction.catalog.flagey</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Catalog Flagey Report">
+ <label string="Print Auction Catalog Flagey Report..."/>
+ <group col="2" colspan="4">
+ <button icon='gtk-cancel' special="cancel"
+ string="Cancel" />
+ <button name="print_report" string="Ok"
+ colspan="1" type="object" icon="gtk-ok" />
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <act_window name="Auction Catalog Flagey"
+ res_model="auction.catalog.flagey"
+ src_model="auction.dates"
+ view_mode="form"
+ target="new"
+ key2="client_action_multi"
+ id="action_auction_catalog_flagey_wizard"/>
+ </data>
+</openerp>