Fault: can't adapt type 'stock.location' error when using cost per warehouse in product configuration
I am getting the below error when I run report products by location for a warehouse. The below error shows only when cost per warehouse is activated in product configuration.
Traceback (most recent call last):
File "/usr/local/lib/python39/dist-packages/trytond/wsgipy", line 117, in dispatch_request
return endpoint(request, **requestview_args)
File "/usr/local/lib/python39/dist-packages/trytond/protocols/dispatcherpy", line 46, in rpc
return methodsget(requestrpc_method, _dispatch)(
File "/usr/local/lib/python39/dist-packages/trytond/wsgipy", line 84, in auth_required
return wrapped(*args, **kwargs)
File "/usr/local/lib/python39/dist-packages/trytond/protocols/wrapperspy", line 159, in wrapper
return func(request, pool, *args, **kwargs)
File "/usr/local/lib/python39/dist-packages/trytond/protocols/dispatcherpy", line 180, in _dispatch
result = rpcresult(meth(*c_args, **c_kwargs))
File "/usr/local/lib/python39/dist-packages/trytond/model/modelsqlpy", line 891, in read
getter_results = fieldget(
File "/usr/local/lib/python39/dist-packages/trytond/model/fields/functionpy", line 105, in get
return dict((name, call(name)) for name in names)
File "/usr/local/lib/python39/dist-packages/trytond/model/fields/functionpy", line 105, in <genexpr>
return dict((name, call(name)) for name in names)
File "/usr/local/lib/python39/dist-packages/trytond/model/fields/functionpy", line 100, in call
return dict((rid, method(r, name)) for r in records)
File "/usr/local/lib/python39/dist-packages/trytond/model/fields/functionpy", line 100, in <genexpr>
return dict((rid, method(r, name)) for r in records)
File "/usr/local/lib/python39/dist-packages/trytond/modules/stock/locationpy", line 799, in get_product
value = getattr(selfproduct, name)
File "/usr/local/lib/python39/dist-packages/trytond/model/fields/functionpy", line 129, in __get__
return super()__get__(inst, cls)
File "/usr/local/lib/python39/dist-packages/trytond/model/fields/fieldpy", line 342, in __get__
return inst__getattr__(selfname)
File "/usr/local/lib/python39/dist-packages/trytond/model/modelstoragepy", line 1697, in __getattr__
read_data = selfread(list(indexkeys()), list(ffieldskeys()))
File "/usr/local/lib/python39/dist-packages/trytond/model/modelsqlpy", line 891, in read
getter_results = fieldget(
File "/usr/local/lib/python39/dist-packages/trytond/model/fields/functionpy", line 105, in get
return dict((name, call(name)) for name in names)
File "/usr/local/lib/python39/dist-packages/trytond/model/fields/functionpy", line 105, in <genexpr>
return dict((name, call(name)) for name in names)
File "/usr/local/lib/python39/dist-packages/trytond/model/fields/functionpy", line 98, in call
return method(records, name)
File "/usr/local/lib/python39/dist-packages/trytond/modules/stock/productpy", line 173, in get_cost_value
if productcost_price is not None:
File "/usr/local/lib/python39/dist-packages/trytond/model/fields/functionpy", line 129, in __get__
return super()__get__(inst, cls)
File "/usr/local/lib/python39/dist-packages/trytond/model/fields/fieldpy", line 342, in __get__
return inst__getattr__(selfname)
File "/usr/local/lib/python39/dist-packages/trytond/model/modelstoragepy", line 1697, in __getattr__
read_data = selfread(list(indexkeys()), list(ffieldskeys()))
File "/usr/local/lib/python39/dist-packages/trytond/model/modelsqlpy", line 891, in read
getter_results = fieldget(
File "/usr/local/lib/python39/dist-packages/trytond/model/fields/functionpy", line 105, in get
return dict((name, call(name)) for name in names)
File "/usr/local/lib/python39/dist-packages/trytond/model/fields/functionpy", line 105, in <genexpr>
return dict((name, call(name)) for name in names)
File "/usr/local/lib/python39/dist-packages/trytond/model/fields/functionpy", line 100, in call
return dict((rid, method(r, name)) for r in records)
File "/usr/local/lib/python39/dist-packages/trytond/model/fields/functionpy", line 100, in <genexpr>
return dict((rid, method(r, name)) for r in records)
File "/usr/local/lib/python39/dist-packages/trytond/model/multivaluepy", line 57, in _multivalue_getter
value = selfget_multivalue(name)
File "/usr/local/lib/python39/dist-packages/trytond/modules/product_kit/productpy", line 72, in get_multivalue
value = super()get_multivalue(name, **pattern)
File "/usr/local/lib/python39/dist-packages/trytond/modules/product_cost_warehouse/productpy", line 67, in get_multivalue
return super()get_multivalue(name, **pattern)
File "/usr/local/lib/python39/dist-packages/trytond/modules/product_cost_history/productpy", line 52, in get_multivalue
cost_price = selfget_cost_price_at(datetimedate(), **pattern)
File "/usr/local/lib/python39/dist-packages/trytond/modules/product_cost_history/productpy", line 63, in get_cost_price_at
records = CostHistorysearch([
File "/usr/local/lib/python39/dist-packages/trytond/model/modelsqlpy", line 1459, in search
cursorexecute(*select)
File "/usr/local/lib/python39/dist-packages/trytond/backend/postgresql/databasepy", line 72, in execute
cursorexecute(self, sql, args)
psycopg2ProgrammingError: can't adapt type 'stocklocation'
Fault: can't adapt type 'stock.location'