Tryton - Issues

 

Issue8087

Title Date field becomes empty when focus is changed
Priority bug Status resolved
Superseder Nosy List ced, prakharb, reviewbot, roundup-bot
Type crash Components tryton
Assigned To ced Keywords review
Reviews 273221002
View: 273221002

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

Messages
New changeset 4dcaa207e5b6 by Cédric Krier in branch '5.0':
Prevent exception when parsing date
https://hg.tryton.org/tryton/rev/4dcaa207e5b6

New changeset 627b7fbf911f by Cédric Krier in branch '4.8':
Prevent exception when parsing date
https://hg.tryton.org/tryton/rev/627b7fbf911f

New changeset a7d8959deff5 by Cédric Krier in branch '4.6':
Prevent exception when parsing date
https://hg.tryton.org/tryton/rev/a7d8959deff5

New changeset e60c2e04fc9b by Cédric Krier in branch '4.4':
Prevent exception when parsing date
https://hg.tryton.org/tryton/rev/e60c2e04fc9b

New changeset 24063bdbcebf by Cédric Krier in branch '4.2':
Prevent exception when parsing date
https://hg.tryton.org/tryton/rev/24063bdbcebf
New changeset 9b1987e0fee2 by Cédric Krier in branch 'default':
Prevent exception when parsing date
https://hg.tryton.org/tryton-env/rev/9b1987e0fee2
New changeset af3d7df49a8a by Cédric Krier in branch 'default':
Prevent exception when parsing date
https://hg.tryton.org/tryton/rev/af3d7df49a8a
New review273221002 at https://codereview.tryton.org/273221002/#ps263251002
msg48346 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-04-02.23:53:50
Here is review273221002 which should stronger the date parsing for non-numerical format.
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-05-04 11:15:22roundup-botsetmessages: + msg49612
2019-04-23 09:08:15roundup-botsetmessages: + msg49144
2019-04-23 09:08:14roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg49143
2019-04-03 00:10:45reviewbotsetnosy: + reviewbot
messages: + msg48347
2019-04-03 00:10:42reviewbotsetreviews: 273221002
keyword: + review
2019-04-02 23:53:50cedsetstatus: chatting -> testing
assignedto: ced
messages: + msg48346
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