0

I used aeroo report for generating xls report in openerp 7, I created ods file containing data as input file, and xls as output enter image description here

I used python function return arabic string,

    def _test(self, data):
    res=[]
    for item in data :
        month_move=datetime.strptime(str(item.date), '%Y-%m-%d %H:%M:%S').year
        if month_move == date.today().year:
            res.append(item)
    return res,'الاتبللا'

and i have some date is an arabic letter, when i tried to print the report, i got this error msg:

Aeroo Reports: Error while generating the report. ascii

enter image description here I got that error if i use the function, but if i dont used it, the report generate correctly,

I used Genshi package version 6.0, and libreoffice version 5.1, and openerp version 7 , and python version 2.7

forgive me for my bad english, and thank an advence enter image description here

khelili miliana
  • 3,730
  • 2
  • 15
  • 28

1 Answers1

1

It looks like there is an encoding problem with the second return argument:

'الاتبللا'

You did not prefix the string with u, which is needed in Python 2. Even better, import unicode_literals.

Community
  • 1
  • 1
Jim K
  • 12,824
  • 2
  • 22
  • 51