bug in carrier-weight ?

42 views
Skip to first unread message

JC Michel

unread,
May 15, 2018, 4:51:40 AM5/15/18
to tryton

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

30 rue Jean-Baptiste Say
69001 LYON
FRANCE

www.symetrie.com

www.facebook.com/symetrie | www.twitter.com/symetriecom | www.linkedin.com/company/symetrie-music-publisher

tél : +33 (0) 478 29 52 14

Sergi Almacellas Abellana

unread,
May 15, 2018, 7:21:01 AM5/15/18
to try...@googlegroups.com
El 15/05/18 a les 10:51, JC Michel ha escrit:
> 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?

Yes, you should open a bug with the steps to reproduce it on a fresh
database and with the stack trace generated.

>
> PS : tryton version 4.6
>
It seems that you are also using python3 version. It will be great if
you can confirm it on the issue.

> Jean-Christophe Michel
> --
>
>
> SYMÉTRIE, livres et partitions
>
> 30 rue Jean-Baptiste Say
> 69001 LYON
> FRANCE
>
> www.symetrie.com <https://symetrie.com>
>
> www.facebook.com/symetrie <http://facebook.com/symetrie> |
> www.twitter.com/symetriecom <http://twitter.com/symetriecom> |
> www.linkedin.com/company/symetrie-music-publisher
> <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
> <https://groups.google.com/d/msgid/tryton/4CD16F9A-49E1-4E41-9F0C-C1443E8B27B8%40symetrie.com?utm_medium=email&utm_source=footer>.


--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

Cédric Krier

unread,
May 17, 2018, 7:55:09 PM5/17/18
to try...@googlegroups.com
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

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

JC Michel

unread,
May 18, 2018, 7:58:24 AM5/18/18
to try...@googlegroups.com

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
--

SYMÉTRIE, livres et partitions

30 rue Jean-Baptiste Say
69001 LYON
FRANCE

www.symetrie.com

www.facebook.com/symetrie | www.twitter.com/symetriecom | www.linkedin.com/company/symetrie-music-publisher

tél : +33 (0) 478 29 52 14

Reply all
Reply to author
Forward
0 new messages