AttributeError: 'StockRequired' object has no attribute 'num_available'

17 views
Skip to first unread message

meig...@meigallodixital.com

unread,
Feb 17, 2021, 8:25:19 AM2/17/21
to django-oscar
The error is:
Exception Value:
'StockRequired' object has no attribute 'num_available'Exception Location:
d:\eshop\venv\lib\site-packages\oscar\apps\partner\availability.py, line 86, in is_purchase_permitted  

I did an import by  code varopus products with their stockrecords. All stockrecords are configured like this:

|id |partner_sku|price_currency|price|num_in_stock|num_allocated|low_stock_threshold|date_created                 |date_updated                 |partner_id|product_id|cost_price|price_retail|
|---|-----------|--------------|-----|------------|-------------|-------------------|-----------------------------|-----------------------------|----------|----------|----------|------------|
|5  |21010001   |EUR           |0.00 |1           |0            |1                  |2021-02-17 10:20:01.945251+01|2021-02-17 13:37:52.210707+01|1         |5         |0.00      |0.00        |

Both num_in_stock, num_allocated and low_stock_threshold are with values (1, 0 ,1). I don't understand where that error comes from. It was just after importing, the dashboard works correctly.  

meig...@meigallodixital.com

unread,
Feb 17, 2021, 9:28:35 AM2/17/21
to django-oscar
Update. Cleaned database and making one by dashboard breaks too ...

meig...@meigallodixital.com

unread,
Feb 17, 2021, 11:50:12 AM2/17/21
to django-oscar
Rebuilded venv and error gone ... I dont know what happened .... :\ 
Reply all
Reply to author
Forward
0 new messages