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
tél : +33 (0) 478 29 52 14
Hello,
On 18 May 2018, at 0:21, Cédric Krier wrote:
On 2018-05-15 13:20, Sergi Almacellas Abellana wrote:
Yes, you should open a bug with the steps to reproduce it on a fresh
database and with the stack trace generated.I did not see the bug report so I created https://bugs.tryton.org/issue7441
Sorry, I didn’t have the time to create the ‘fresh new db’ before reporting…
Jean-Christophe Michel
--

30 rue Jean-Baptiste Say
69001 LYON
FRANCE