Issue 11501

Title
Crash when stock supply and user has not company
Priority
bug
Status
unread
Nosy list
resteve
Assigned to
Keywords
easy

Created on 2022-05-18.16:14:22 by resteve, last changed 4 months ago by pokoli.

Messages

Author: [hidden] (resteve)
Date: 2022-05-18.16:14:22
  1. Install stock_supply module
  2. Create user that has not company
  3. Logistic / Stock supply menu -> generate_requests()

traceback:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 117, in dispatch_request
    return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 46, in rpc
    return methods.get(request.rpc_method, _dispatch)(
  File "/trytond/wsgi.py", line 84, in auth_required
    return wrapped(*args, **kwargs)
  File "/trytond/protocols/wrappers.py", line 159, in wrapper
    return func(request, pool, *args, **kwargs)
  File "/trytond/protocols/dispatcher.py", line 180, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/trytond/wizard/wizard.py", line 314, in execute
    return wizard._execute(state_name)
  File "/trytond/wizard/wizard.py", line 345, in _execute
    result = self._execute(transition())
  File "/trytond/modules/stock_supply_forecast/stock.py", line 20, in transition_create_
    res = super(StockSupply, self).transition_create_()
  File "/trytond/modules/stock_supply_production/stock.py", line 94, in transition_create_
    return super(StockSupply, self).transition_create_()
  File "/trytond/modules/stock_supply/stock.py", line 72, in transition_create_
    created |= bool(getattr(self, 'generate_%s' % type_)(first))
  File "/trytond/modules/stock_supply/stock.py", line 106, in generate_purchase
    PurchaseRequest.generate_requests(**self._purchase_parameters)
  File "/trytond/modules/stock_supply/purchase_request.py", line 90, in generate_requests
    product, company=company.id)
AttributeError: 'NoneType' object has no attribute 'id'
History
Date User Action Args
2022-05-20 11:07:56pokolisetkeyword: + easy
status: chatting -> unread
2022-05-18 16:14:22restevecreate

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