Tryton - Issues

 

Issue8087

Title Date field becomes empty when focus is changed
Priority bug Status chatting
Superseder Nosy List ced, prakharb
Type crash Components tryton
Assigned To Keywords
Reviews

Created on 2019-02-07.11:37:19 by prakharb, last changed by prakharb.

Messages
msg46835 (view) Author: [hidden] (prakharb) Date: 2019-02-07.12:02:41
I had to put line (http://hg.tryton.org/tryton/file/5.0/tryton/common/datetime_.py#l89) out of try-except block to get the traceback

ERROR:tryton.common.common:  File "/home/prakhar/workspace/tryton/tryton50/src/tryton/tryton/common/datetime_.py", line 159, in focus_out
    self.parse()
  File "/home/prakhar/workspace/tryton/tryton50/src/tryton/tryton/common/datetime_.py", line 94, in parse
    date = date_parse(text, self.__format).date()
  File "/home/prakhar/workspace/tryton/tryton50/src/tryton/tryton/common/datetime_.py", line 23, in date_parse
    monthfirst = formatted_date.index('7') <= 1

substring not found


To add further to it, the locale here is en_IN. See the following output from python prompt.

>>> locale.getlocale()
('en_IN', 'ISO8859-1')
>>> datetime.today().strftime('%x')
'Thursday 07 February 2019'
msg46834 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-02-07.11:42:05
Could you provide the traceback.
msg46833 (view) Author: [hidden] (prakharb) Date: 2019-02-07.11:37:18
The issue comes up in Tryton 5.0 client when the date field gets out of focus. It is due to an issue in the parser. The date field takes the string in the format - "Thursday 28 February 2019", whereas the code in the Tryton client checks for month as '7' (ref - http://hg.tryton.org/tryton/file/5.0/tryton/common/datetime_.py#l23)
History
Date User Action Args
2019-02-07 12:02:41prakharbsetmessages: + msg46835
2019-02-07 11:42:05cedsetstatus: unread -> chatting
nosy: + ced
messages: + msg46834
2019-02-07 11:37:19prakharbcreate

Showing 10 items. Show all history (warning: this could be VERY long)