Tryton - Issues



Title Crash when process a purchase from purchase request created from a sale
Priority bug Status testing
Superseder Nosy List ced, resteve, reviewbot
Type crash Components sale_supply_drop_shipment
Assigned To ced Keywords review
Reviews 269181002
View: 269181002

Created on 2019-01-24.13:29:24 by resteve, last changed by reviewbot.

review269181002 updated at
msg47694 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2019-03-17.10:03:46
This is an unusual workfow as such added line will not be linked to a sale and so not invoices to the customer.
Any way, here is review269181002 which should avoid the crash.
msg46217 (view) Author: [hidden] (resteve) Date: 2019-01-24.13:29:24
Install sale_supply_drop_shipment


1- Create a purchase request from a sale
2- Create a purchase from the purchase request
3- The purchase created from the purchase request, add new line.
4- Process the purchase -> create shipment drop in wait state and crash

Traceback (most recent call last):
  File "/trytond/", line 71, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/", line 41, in rpc
    request, database_name, *request.rpc_params)
  File "/trytond/", line 42, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/", line 122, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/", line 178, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/model/", line 644, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/trytond/modules/sale_supply/", line 74, in process
    super(Purchase, cls).process(purchases)
  File "/trytond/model/", line 644, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/trytond/modules/purchase/", line 887, in process
  File "/trytond/modules/sale_supply_drop_shipment/", line 164, in create_move
  File "/trytond/model/", line 644, in wrapper
    return func(cls, records, *args, **kwargs)
  File "/trytond/model/", line 36, in wrapper
    result = func(cls, filtered, *args, **kwargs)
  File "/trytond/modules/sale_supply_drop_shipment/", line 560, in wait
    sale_line = request2sline[pline2request[move.origin]]
KeyError: Pool().get('purchase.line')(4995)

Debug data:

(Pdb) pline2request
{Pool().get('purchase.line')(4994): Pool().get('purchase.request')(15192)}
(Pdb) move.origin
(Pdb) pline2request.get(move.origin)
Date User Action Args
2019-03-17 10:17:10reviewbotsetnosy: + reviewbot
messages: + msg47695
2019-03-17 10:03:47cedsetstatus: chatting -> testing
keyword: + review
nosy: + ced
messages: + msg47694
reviews: 269181002
assignedto: ced
2019-01-24 13:29:24restevecreate

Showing 10 items. Show all history (warning: this could be VERY long)