1 # -*- encoding: utf-8 -*-
2 # -*-encoding: iso8859-1 -*-
3 ##############################################################################
5 # Copyright (c) 2004 TINY SPRL. (http://tiny.be) All Rights Reserved.
6 # Fabien Pinckaers <fp@tiny.Be>
8 # WARNING: This program as such is intended to be used by professional
9 # programmers who take the whole responsability of assessing all potential
10 # consequences resulting from its eventual inadequacies and bugs
11 # End users who are looking for a ready-to-use solution with commercial
12 # garantees and support are strongly adviced to contract a Free Software
15 # This program is Free Software; you can redistribute it and/or
16 # modify it under the terms of the GNU General Public License
17 # as published by the Free Software Foundation; either version 2
18 # of the License, or (at your option) any later version.
20 # This program is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 ####################################### i#######################################
32 from osv.osv import osv, orm
33 from report.interface import report_rml
34 #FIXME: use the one from tools and delete the one from report
35 from report.int_to_text import int_to_text
38 return val.replace('&', '&').replace('<','<').replace('>','>').decode('utf-8').encode('latin1', 'replace')
40 class report_custom(report_rml):
41 def __init__(self, name, table, tmpl, xsl):
42 report_rml.__init__(self, name, table, tmpl, xsl)
44 def create_xml(self,cr, uid, ids, datas, context={}):
45 pool= pooler.get_pool(cr.dbname)
46 lots = pool.get('auction.lots').browse(cr, uid, ids)
47 auction = lots[0].auction_id
49 xml = '''<?xml version="1.0" encoding="ISO-8859-1"?>
53 <date-au1>%s</date-au1>
54 </auction>''' % (toxml(auction['name']), toxml(auction['auction1']))
58 # l['id_cont'] = str(i)
60 price_french = 'retiré'
62 price_french = int_to_text(int(l['obj_price'] or 0.0))+' eur'
67 <lot_desc>%s</lot_desc>
69 <obj_price>%s</obj_price>
70 </object>''' % (i, l['obj_num'], toxml(l['name']), price_french, str(l['obj_price'] or '/'))
73 # file('/tmp/terp.xml','wb+').write(xml)
76 report_custom('report.flagey.huissier', 'auction.lots', '', 'addons/auction/report/huissier.xsl')
79 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: