JC Michel
2018-05-15 08:51:41 UTC
Hi,
When using carrier-weight to compute an invoice line for a carrier
depending on weight:
when coming back, in Sale, to Draft state to edit the Carrier, the
generated carrier invoice line is not deleted,
and creates an error
File "/trytond/modules/sale_shipment_cost/sale.py", line 207, in
set_shipment_cost
with Transaction().set_context(self._get_carrier_context()):
File "/trytond/modules/carrier_weight/sale.py", line 33, in
_get_carrier_context
lines = sorted(lines, key=keyfunc)
TypeError: unorderable types: NoneType() < NoneType()
Seems that the carrier line doesnât have a weight!
Deleting manually the invoice line seems to fix this.
IMHO the carrier line should be deleted when going back in Draft state.
Should I open a bug?
PS : tryton version 4.6
Jean-Christophe Michel
\--

---
30 rue Jean-Baptiste Say
69001 LYON
FRANCE
[www.symetrie.com](<https://symetrie.com>)
[](<http://facebook.com/symetrie>)
|
[](<http://twitter.com/symetriecom>)
|
[](<http://www.linkedin.com/company/symetrie-music-publisher>)
tél : +33 (0) 478 29 52 14
When using carrier-weight to compute an invoice line for a carrier
depending on weight:
when coming back, in Sale, to Draft state to edit the Carrier, the
generated carrier invoice line is not deleted,
and creates an error
File "/trytond/modules/sale_shipment_cost/sale.py", line 207, in
set_shipment_cost
with Transaction().set_context(self._get_carrier_context()):
File "/trytond/modules/carrier_weight/sale.py", line 33, in
_get_carrier_context
lines = sorted(lines, key=keyfunc)
TypeError: unorderable types: NoneType() < NoneType()
Seems that the carrier line doesnât have a weight!
Deleting manually the invoice line seems to fix this.
IMHO the carrier line should be deleted when going back in Draft state.
Should I open a bug?
PS : tryton version 4.6
Jean-Christophe Michel
\--

[ 478 29 52 14
--
You received this message because you are subscribed to the Google Groups "tryton" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/4CD16F9A-49E1-4E41-9F0C-C1443E8B27B8%40symetrie.com.
You received this message because you are subscribed to the Google Groups "tryton" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/4CD16F9A-49E1-4E41-9F0C-C1443E8B27B8%40symetrie.com.