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
\--
![SYMÉTRIE, livres et partitions](http://symetrie.free.fr/signature/symetrie.png "SYMÉTRIE")
---
30 rue Jean-Baptiste Say
69001 LYON
FRANCE

[www.symetrie.com](<https://symetrie.com>)

[![www.facebook.com/symetrie](http://symetrie.free.fr/signature/f.png)](<http://facebook.com/symetrie>) | [![www.twitter.com/symetriecom](http://symetrie.free.fr/signature/t.png)](<http://twitter.com/symetriecom>) | [![www.linkedin.com/company/symetrie-music-publisher](http://symetrie.free.fr/signature/l.png)](<http://www.linkedin.com/company/symetrie-music-publisher>)

tél : +33 (0) 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.

Reply via email to