Tryton - Issues

 

Issue8108

Title fails to compute carrier when there are some comment lines in the sale
Priority bug Status resolved
Superseder Nosy List jcm, pokoli, reviewbot, roundup-bot
Type crash Components carrier_weight
Assigned To pokoli Keywords Python3, review
Reviews 56601002
View: 56601002

Created on 2019-02-13.09:47:11 by jcm, last changed by roundup-bot.

Messages
New changeset 56d995286dd1 by Sergi Almacellas Abellana in branch '5.0':
Exclude lines without quantity when computing carrier context
https://hg.tryton.org/modules/carrier_weight/rev/56d995286dd1

New changeset 0a78a3d4d0cb by Sergi Almacellas Abellana in branch '4.8':
Exclude lines without quantity when computing carrier context
https://hg.tryton.org/modules/carrier_weight/rev/0a78a3d4d0cb
New changeset 1967e256d10a by Sergi Almacellas Abellana in branch 'default':
Exclude lines without quantity when computing carrier context
https://hg.tryton.org/tryton-env/rev/1967e256d10a
New changeset 99cef7cd377d by Sergi Almacellas Abellana in branch 'default':
Exclude lines without quantity when computing carrier context
https://hg.tryton.org/modules/carrier_weight/rev/99cef7cd377d

New changeset 7850847242af by Sergi Almacellas Abellana in branch 'default':
Add line without quantity on test scenario
https://hg.tryton.org/modules/carrier_weight/rev/7850847242af
msg47030 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2019-02-13.20:46:38
Here is review56601002 that should fix it, could you confirm please?
New review56601002 at https://codereview.tryton.org/56601002/#ps1
msg46963 (view) Author: [hidden] (jcm) Date: 2019-02-13.09:47:10
When a comment line is added in the sale and a carrier with weight list-price is used, click on Quote button crashes.
IMHO the line type or the existence of quantity should be checked on li 31. 

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 73, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 46, in rpc
    request, database_name, *request.rpc_params)
  File "/trytond/wsgi.py", line 44, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 122, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 176, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/modelview.py", line 665, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/trytond/model/workflow.py", line 36, in wrapper
    result = func(cls, filtered, *args, **kwargs)
  File "/trytond/modules/sale_shipment_cost/sale.py", line 186, in quote
    removed.extend(sale.set_shipment_cost())
  File "/trytond/modules/sale_shipment_cost/sale.py", line 215, in set_shipment_cost
    with Transaction().set_context(self._get_carrier_context()):
  File "/trytond/modules/carrier_weight/sale.py", line 31, in _get_carrier_context
    lines = [l for l in self.lines or [] if l.quantity > 0]
  File "/trytond/modules/carrier_weight/sale.py", line 31, in <listcomp>
    lines = [l for l in self.lines or [] if l.quantity > 0]
TypeError: unorderable types: NoneType() > int()
History
Date User Action Args
2019-02-28 23:22:13roundup-botsetmessages: + msg47270
2019-02-22 19:51:33roundup-botsetmessages: + msg47172
2019-02-22 19:51:22roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg47171
2019-02-13 20:46:39pokolisetstatus: chatting -> testing
assignedto: pokoli
messages: + msg47030
nosy: + pokoli
2019-02-13 20:45:58reviewbotsetstatus: unread -> chatting
nosy: + reviewbot
messages: + msg47029
2019-02-13 20:45:57reviewbotsetreviews: 56601002
keyword: + review
2019-02-13 09:57:40cedsetkeyword: + Python3
2019-02-13 09:47:11jcmcreate