Date is unicode or datetime in no_rate user error
Date in transaction context is unicode or datetime [1]
(Pdb) date = Transaction().context.get('date', Date.today())
(Pdb) type(date)
<type 'unicode'>
(Pdb) ndate = Date.today()
(Pdb) type(ndate)
<type 'datetime.date'>
(Pdb) datetime_strftime(ndate, str(languages[0].date))
'02/21/2017'
(Pdb) datetime_strftime(date, str(languages[0].date))
*** AttributeError: 'unicode' object has no attribute 'year'
The traceback:
File "/home/resteve/virtualenv/nan40/trytond/trytond/modules/currency/currency.py", line 235, in compute
'date': datetime_strftime(date, str(languages[0].date))
File "/home/resteve/virtualenv/nan40/trytond/trytond/tools/datetime_strftime.py", line 12, in datetime_strftime
if date.year > 1900:
AttributeError: 'unicode' object has no attribute 'year'
[1] https://bitbucket.org/tryton/currency/src/a6e3f61d07339c7003ae9dd2322c5cf24bad2dba/currency.py?at=default&fileviewer=file-view-default#currency.py-224