Issue 10582

Title
Crash when opening product quantitys by warehouse from an internal shipment without planned date
Priority
bug
Status
resolved
Nosy list
ced, pokoli, reviewbot, roundup-bot
Assigned to
pokoli
Keywords
review

Created on 2021-07-14.08:55:34 by pokoli, last changed 1 month ago by roundup-bot.

Messages

New changeset aed3fc1695a1 by Sergi Almacellas Abellana in branch '6.0':
Do not compare planned_date when empty
https://hg.tryton.org/modules/stock/rev/aed3fc1695a1
New changeset c86d8f3304b3 by Sergi Almacellas Abellana in branch 'default':
Do not compare planned_date when empty
https://hg.tryton.org/tryton-env/rev/c86d8f3304b3
New changeset f5b129f28f90 by Sergi Almacellas Abellana in branch 'default':
Do not compare planned_date when empty
https://hg.tryton.org/modules/stock/rev/f5b129f28f90
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2021-07-14.09:14:38
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-07-14.09:13:45

I guess we should just replace the hasattr by getattr with a default value None. If the shipment is not planned, we have no upper limit to show.

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2021-07-14.08:55:34

On 6.0 series, if you create an internal shipment without planned date and then try to open the Product Quantities by Warehouse the following traceback is shown:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 117, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 47, in rpc
    return methods.get(request.rpc_method, _dispatch)(
  File "/trytond/wsgi.py", line 84, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 156, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 181, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/wizard/wizard.py", line 314, in execute
    return wizard._execute(state_name)
  File "/trytond/wizard/wizard.py", line 340, in _execute
    do_result = do(actio
  File "/trytond/modules/stock/product.py", line 453, in do_open_
    action['pyson_search_value'] = encoder.encode(self.get_search_value())
  File "/trytond/modules/stock/product.py", line 477, in get_search_value
    and self.record.planned_date >= today):
TypeError: '>=' not supported between instances of 'NoneType' and 'datetime.date'
History
Date User Action Args
2021-08-05 23:59:17roundup-botsetkeyword: - backport
messages: + msg69174
2021-07-22 17:03:20roundup-botsetmessages: + msg69024
2021-07-22 17:03:15roundup-botsetmessages: + msg69023
nosy: + roundup-bot
status: testing -> resolved
2021-07-14 09:21:50reviewbotsetmessages: + msg68911
nosy: + reviewbot
2021-07-14 09:14:38pokolisetkeyword: + review
messages: + msg68910
reviews: 365621002
status: in-progress -> testing
2021-07-14 09:13:45cedsetmessages: + msg68909
nosy: + ced
2021-07-14 08:55:34pokolicreate

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