1 # -*- coding: utf-8 -*-
2 ##############################################################################
4 # OpenERP, Open Source Management Solution
5 # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as
9 # published by the Free Software Foundation, either version 3 of the
10 # License, or (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ##############################################################################
23 from report.interface import report_rml
24 #FIXME: use the one from tools and delete the one from report
25 from report.int_to_text import int_to_text
26 from tools import to_xml as toxml
27 from tools import ustr
29 class report_custom(report_rml):
30 def __init__(self, name, table, tmpl, xsl):
31 report_rml.__init__(self, name, table, tmpl, xsl)
33 def create_xml(self,cr, uid, ids, datas, context=None):
34 pool= pooler.get_pool(cr.dbname)
35 lots = pool.get('auction.lots').browse(cr, uid, ids, context=context)
36 auction = lots[0].auction_id
38 xml = '''<?xml version="1.0" encoding="UTF-8"?>
42 <date-au1>%s</date-au1>
43 </auction>''' % (toxml(auction['name']), toxml(auction['auction1']))
48 price_french = u'retiré'
50 price_french = int_to_text(int(l['obj_price'] or 0.0))+' eur'
55 <lot_desc>%s</lot_desc>
57 <obj_price>%s</obj_price>
58 </object>''' % (i, l['obj_num'], ustr(toxml(l['name'])), ustr(price_french), ustr(l['obj_price'] or '/'))
63 report_custom('report.flagey.huissier', 'auction.lots', '', 'addons/auction/report/huissier.xsl')
66 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: