Nehal Panchal (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/6.0-xmlreport-improvements-nep into
lp:openobject-addons/6.0.
Requested reviews:
Anup(OpenERP) (ach-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-xmlreport-improvements-nep/+merge/65335
--
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-xmlreport-improvements-nep/+merge/65335
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/6.0-xmlreport-improvements-nep.
=== modified file 'auction/report/huissier.py'
--- auction/report/huissier.py 2011-01-14 00:11:01 +0000
+++ auction/report/huissier.py 2011-06-21 11:52:34 +0000
@@ -22,9 +22,9 @@
import pooler
from osv.osv import osv, orm
from report.interface import report_rml
+from report.interface import toxml
#FIXME: use the one from tools and delete the one from report
from report.int_to_text import int_to_text
-from tools import to_xml as toxml
from tools import ustr
class report_custom(report_rml):
=== modified file 'auction/report/total.py'
--- auction/report/total.py 2011-01-14 00:11:01 +0000
+++ auction/report/total.py 2011-06-21 11:52:34 +0000
@@ -27,9 +27,9 @@
import report.render
import report.common
from report.interface import report_rml
-
-def toxml(val):
- return val.replace('&', '&').replace('<','<').replace('>','>').decode('utf-8').encode('latin1')
+from report.interface import toxml
+
+
class report_custom(report_rml):
def __init__(self, name, table, tmpl, xsl):
@@ -111,7 +111,7 @@
<sell_nbr>%d</sell_nbr>
<debit>%.2f</debit>
</seller>
-</report>''' % (time.strftime('%d/%m/%Y'), toxml(auction['name']), auction['auction1'], len(lots), est1, est2, unsold, adj, len(buyer), len(paid_ids), comm, emp, unpaid, paid, len(seller), debit)
+</report>''' % (time.strftime('%d/%m/%Y'), toxml(auction['name']), toxml(auction['auction1']), len(lots), est1, est2, unsold, adj, len(buyer), len(paid_ids), comm, emp, unpaid, paid, len(seller), debit)
return self.post_process_xml_data(cr, uid, xml, context)
=== modified file 'hr_attendance/report/attendance_by_month.py'
--- hr_attendance/report/attendance_by_month.py 2011-01-17 18:02:22 +0000
+++ hr_attendance/report/attendance_by_month.py 2011-06-21 11:52:34 +0000
@@ -103,7 +103,7 @@
<date>%s</date>
<company>%s</company>
</header>
- ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name)
+ ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),toxml(pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name))
first_date = str(month)
som = datetime.strptime(first_date, '%Y-%m-%d %H:%M:%S')
=== modified file 'hr_holidays/report/holidays_summary_report.py'
--- hr_holidays/report/holidays_summary_report.py 2011-01-17 18:02:22 +0000
+++ hr_holidays/report/holidays_summary_report.py 2011-06-21 11:52:34 +0000
@@ -70,7 +70,7 @@
display[index]=' '
count=''
- data_xml=['<info id="%d" number="%d" val="%s" />' % (row_id,x,display[x]) for x in range(1,len(display)+1) ]
+ data_xml=['<info id="%d" number="%d" val="%s" />' % (row_id,x,toxml(display[x])) for x in range(1,len(display)+1) ]
# Computing the xml
xml = '''
@@ -120,7 +120,7 @@
# date_xml=[]
for l in range(0,len(legend)):
- date_xml += ['<legend row="%d" id="%d" name="%s" color="%s" />' % (l+1,legend[l][0],legend[l][1],legend[l][2])]
+ date_xml += ['<legend row="%d" id="%d" name="%s" color="%s" />' % (l+1,legend[l][0],toxml(legend[l][1]),toxml(legend[l][2]))]
date_xml += ['<date month="%s" year="%d" />' % (som.strftime('%B'), som.year),'<days>']
@@ -235,7 +235,7 @@
<date>%s</date>
<company>%s</company>
</header>
- ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name)
+ ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),toxml(pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,uid).company_id.name))
# Computing the xml
xml='''<?xml version="1.0" encoding="UTF-8" ?>
=== modified file 'hr_timesheet/report/user_timesheet.py'
--- hr_timesheet/report/user_timesheet.py 2011-02-07 11:38:37 +0000
+++ hr_timesheet/report/user_timesheet.py 2011-06-21 11:52:34 +0000
@@ -78,7 +78,7 @@
for presence in cr.dictfetchall():
day = int(presence['date'][-2:])
- account = accounts.setdefault((presence['account_id'], presence['name']), {})
+ account = accounts.setdefault((presence['account_id'], toxml(presence['name'])), {})
account[day] = account.get(day, 0.0) + presence['amount']
xml = '''
@@ -94,7 +94,7 @@
<date>%s</date>
<company>%s</company>
</header>
- ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,user_id).company_id.name)
+ ''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),toxml(pooler.get_pool(cr.dbname).get('res.users').browse(cr,uid,user_id).company_id.name))
account_xml = []
for account, telems in accounts.iteritems():
=== modified file 'product/report/pricelist.py'
--- product/report/pricelist.py 2011-02-15 10:55:46 +0000
+++ product/report/pricelist.py 2011-06-21 11:52:34 +0000
@@ -62,8 +62,8 @@
date = datetime.date.today()
str_date=date.strftime("%d/%m/%Y")
product_xml.append('<cols>'+cols+'</cols>')
- product_xml.append('<pricelist> %s </pricelist>'%currency['name'])
- product_xml.append('<currency> %s </currency>'%currency['currency_id'][1])
+ product_xml.append('<pricelist> %s </pricelist>'% toxml(currency['name']))
+ product_xml.append('<currency> %s </currency>'% toxml(currency['currency_id'][1]))
product_xml.append('<date> %s </date>'%str_date)
product_xml.append("<product>")
@@ -74,7 +74,7 @@
products = pool.get('product.product').read(cr, uid, product_ids, ['id','name','code'])
pro = []
i=0
- pro.append('<pro name="%s" categ="true">' % (categ_name[0]['name']))
+ pro.append('<pro name="%s" categ="true">' % toxml(categ_name[0]['name']))
temp = []
for q in qty:
temp.append('<price name=" " />')
@@ -85,9 +85,9 @@
x['name'] = x['name'].replace("&","&")
x['name'] = x['name'].replace("\"",""")
if x['code']:
- pro.append('<pro name="[%s] %s" >' % (x['code'], x['name']))
+ pro.append('<pro name="[%s] %s" >' % (x['code'], toxml(x['name'])))
else:
- pro.append('<pro name="%s" >' % (x['name']))
+ pro.append('<pro name="%s" >' % toxml(x['name']))
temp = []
for q in qty:
price_dict = pool.get('product.pricelist').price_get(cr, uid, [price_list_id], x['id'], q, context=context)
=== modified file 'stock/report/stock_by_location.py'
--- stock/report/stock_by_location.py 2011-01-14 00:11:01 +0000
+++ stock/report/stock_by_location.py 2011-06-21 11:52:34 +0000
@@ -50,14 +50,14 @@
xml = '<row>'
location_name = pooler.get_pool(cr.dbname).get('stock.location').read(cr, uid, [location_id], ['name'])
xml += "<col para='yes' tree='yes' space='" + str(3*level) + "mm'>"
- xml += location_name[0]['name'] + '</col>'
+ xml += toxml(location_name[0]['name']) + '</col>'
prod_info = pooler.get_pool(cr.dbname).get('stock.location')._product_get(cr, uid, location_id)
xml += "<col>"
for prod_id in prod_info.keys():
if prod_info[prod_id] != 0.0:
prod_name = pooler.get_pool(cr.dbname).get('product.product').read(cr, uid, [prod_id], ['name'])
- xml += prod_name[0]['name'] + '\n'
+ xml += toxml(prod_name[0]['name']) + '\n'
xml += '</col>'
xml += "<col>"
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp