Crash when stock supply and user has not company
- Install stock_supply module
- Create user that has not company
- 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'