{"action":"created","issue":{"url":"https://api.github.com/repos/mirumee/saleor/issues/386","labels_url":"https://api.github.com/repos/mirumee/saleor/issues/386/labels{/name}","comments_url":"https://api.github.com/repos/mirumee/saleor/issues/386/comments","events_url":"https://api.github.com/repos/mirumee/saleor/issues/386/events","html_url":"https://github.com/mirumee/saleor/issues/386","id":115932391,"number":386,"title":"Add stock error","user":{"login":"bryandmc","id":774915,"avatar_url":"https://avatars.githubusercontent.com/u/774915?v=3","gravatar_id":"","url":"https://api.github.com/users/bryandmc","html_url":"https://github.com/bryandmc","followers_url":"https://api.github.com/users/bryandmc/followers","following_url":"https://api.github.com/users/bryandmc/following{/other_user}","gists_url":"https://api.github.com/users/bryandmc/gists{/gist_id}","starred_url":"https://api.github.com/users/bryandmc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryandmc/subscriptions","organizations_url":"https://api.github.com/users/bryandmc/orgs","repos_url":"https://api.github.com/users/bryandmc/repos","events_url":"https://api.github.com/users/bryandmc/events{/privacy}","received_events_url":"https://api.github.com/users/bryandmc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-11-09T18:05:08Z","updated_at":"2015-11-15T14:59:55Z","closed_at":null,"body":"I created a product and then went to go add a stock record for it. As soon as I hit the 'add' link this happens. I tried to track it down but am new to your code and all the traceback appears in django standard library classes. It all has to do with the variant field form -- 'VariantChoiceField'\r\n\r\npip freeze:\r\n\r\nBabel==1.3\r\nBabelDjango==0.2.2\r\nDjango==1.8.6\r\nMarkdown==2.6.4\r\nPillow==3.0.0\r\nPyJWT==1.4.0\r\nUnidecode==0.04.18\r\nargparse==1.2.1\r\nboto==2.38.0\r\nbraintree==3.21.0\r\ncssselect==0.9.1\r\ncssutils==1.0.1\r\ndj-database-url==0.3.0\r\ndjango-absolute==0.3\r\ndjango-emailit==0.2.2\r\ndjango-materializecss-form==0.0.64\r\ndjango-model-utils==2.0.3\r\ndjango-mptt==0.7.4\r\ndjango-offsite-storage==0.0.6\r\ndjango-payments==0.7.3\r\ndjango-prices==0.4.1\r\ndjango-selectable==0.8.0\r\ndjango-versatileimagefield==1.0.6\r\ndjangorestframework==3.1.3\r\nfake-factory==0.5.3\r\ngoogle-measurement-protocol==0.1.4\r\njsonfield==1.0.3\r\nlxml==3.5.0b1\r\npremailer==2.9.6\r\nprices==0.5.4\r\npycrypto==2.6.1\r\npytz==2015.7\r\nrequests==2.8.1\r\nsaleor==0.1.0a0\r\nsatchless==1.1.3\r\nstripe==1.27.1\r\nsuds-jurko==0.6\r\nwsgiref==0.1.2\r\nxmltodict==0.9.2\r\n\r\n\r\nEnvironment:\r\n\r\nRequest Method: GET\r\nRequest URL: http://127.0.0.1:8000/dashboard/products/1/stock/add/\r\n\r\nDjango Version: 1.8.6\r\nPython Version: 2.7.6\r\nInstalled Applications:\r\n['offsite_storage',\r\n 'django.contrib.contenttypes',\r\n 'django.contrib.sessions',\r\n 'django.contrib.messages',\r\n 'django.contrib.sitemaps',\r\n 'django.contrib.sites',\r\n 'django.contrib.staticfiles',\r\n 'django.contrib.admin',\r\n 'django.contrib.auth',\r\n 'django.contrib.webdesign',\r\n 'saleor.userprofile',\r\n 'saleor.product',\r\n 'saleor.cart',\r\n 'saleor.checkout',\r\n 'saleor.core',\r\n 'saleor.order',\r\n 'saleor.registration',\r\n 'saleor.dashboard',\r\n 'versatileimagefield',\r\n 'babeldjango',\r\n 'django_prices',\r\n 'emailit',\r\n 'mptt',\r\n 'payments',\r\n 'selectable',\r\n 'materializecssform',\r\n 'rest_framework']\r\nInstalled Middleware:\r\n['django.contrib.sessions.middleware.SessionMiddleware',\r\n 'django.middleware.common.CommonMiddleware',\r\n 'django.middleware.csrf.CsrfViewMiddleware',\r\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\r\n 'django.contrib.messages.middleware.MessageMiddleware',\r\n 'django.middleware.locale.LocaleMiddleware',\r\n 'babeldjango.middleware.LocaleMiddleware',\r\n 'saleor.cart.middleware.CartMiddleware',\r\n 'saleor.core.middleware.DiscountMiddleware',\r\n 'saleor.core.middleware.GoogleAnalytics',\r\n 'saleor.core.middleware.CheckHTML']\r\n\r\n\r\nTemplate error:\r\nIn template /home/bryan/Projects/mission/mission_naturals/saleor/core/templates/materializecssform/field.html, error at line 92\r\n   'RelatedManager' object has no attribute '_prefetch_related_lookups'\r\n\r\n   82 : \r\n\r\n\r\n\r\n   83 :                     {% if field.help_text %}\r\n\r\n\r\n\r\n   84 :                     <p class=\"help-block\">\r\n\r\n\r\n\r\n   85 :                         {{ field.help_text|safe }}\r\n\r\n\r\n\r\n   86 :                     </p>\r\n\r\n\r\n\r\n   87 :                     {% endif %}\r\n\r\n\r\n\r\n   88 :                 </div>\r\n\r\n\r\n\r\n   89 : \r\n\r\n\r\n\r\n   90 :             {% else %}\r\n\r\n\r\n\r\n   91 :                 <label for=\"{{ field.id_for_label }}\">{{ field.label }}</label>\r\n\r\n\r\n\r\n   92 :                  {{field}} \r\n\r\n\r\n\r\n   93 :                 {% for error in field.errors %}\r\n\r\n\r\n\r\n   94 :                     <p class=\"help-block materialize-red-text\">{{ error }}</p>\r\n\r\n\r\n\r\n   95 :                 {% endfor %}\r\n\r\n\r\n\r\n   96 : \r\n\r\n\r\n\r\n   97 :                 {% if field.help_text %}\r\n\r\n\r\n\r\n   98 :                 <p class=\"help-block\">\r\n\r\n\r\n\r\n   99 :                     {{ field.help_text|safe }}\r\n\r\n\r\n\r\n   100 :                 </p>\r\n\r\n\r\n\r\n   101 :                 {% endif %}\r\n\r\n\r\n\r\n   102 : \r\n\r\n\r\nTraceback:\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/core/handlers/base.py\" in get_response\r\n  164.                 response = response.render()\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/response.py\" in render\r\n  158.             self.content = self.rendered_content\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/response.py\" in rendered_content\r\n  135.         content = template.render(context, self._request)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/backends/django.py\" in render\r\n  74.         return self.template.render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  210.                     return self._render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/base.py\" in _render\r\n  202.         return self.nodelist.render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  905.                 bit = self.render_node(node, context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  79.             return node.render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/loader_tags.py\" in render\r\n  135.         return compiled_parent._render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/base.py\" in _render\r\n  202.         return self.nodelist.render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  905.                 bit = self.render_node(node, context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  79.             return node.render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/loader_tags.py\" in render\r\n  65.                 result = block.nodelist.render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  905.                 bit = self.render_node(node, context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  79.             return node.render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/debug.py\" in render\r\n  89.             output = self.filter_expression.resolve(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/base.py\" in resolve\r\n  675.                 new_obj = func(obj, *arg_vals)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django_materializecss_form-0.0.64-py2.7.egg/materializecssform/templatetags/materializecss.py\" in materializecss\r\n  16.     return render(element, markup_classes)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django_materializecss_form-0.0.64-py2.7.egg/materializecssform/templatetags/materializecss.py\" in render\r\n  53.     return template.render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/backends/django.py\" in render\r\n  74.         return self.template.render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  210.                     return self._render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/base.py\" in _render\r\n  202.         return self.nodelist.render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  905.                 bit = self.render_node(node, context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  79.             return node.render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/defaulttags.py\" in render\r\n  329.                 return nodelist.render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  905.                 bit = self.render_node(node, context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  79.             return node.render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/defaulttags.py\" in render\r\n  329.                 return nodelist.render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/base.py\" in render\r\n  905.                 bit = self.render_node(node, context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/debug.py\" in render_node\r\n  79.             return node.render(context)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/template/debug.py\" in render\r\n  92.             output = force_text(output)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/utils/encoding.py\" in force_text\r\n  92.                 s = six.text_type(s)\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/utils/html.py\" in <lambda>\r\n  390.         klass.__unicode__ = lambda self: mark_safe(klass_unicode(self))\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/forms/forms.py\" in __str__\r\n  537.         return self.as_widget()\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/forms/forms.py\" in as_widget\r\n  593.         return force_text(widget.render(name, self.value(), attrs=attrs))\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/forms/widgets.py\" in render\r\n  513.         options = self.render_options(choices, [value])\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/forms/widgets.py\" in render_options\r\n  539.         for option_value, option_label in chain(self.choices, choices):\r\nFile \"/home/bryan/Projects/mission/saleor/local/lib/python2.7/site-packages/django/forms/models.py\" in __iter__\r\n  1095.         method = 'all' if self.queryset._prefetch_related_lookups else 'iterator'\r\n\r\nException Type: AttributeError at /dashboard/products/1/stock/add/\r\nException Value: 'RelatedManager' object has no attribute '_prefetch_related_lookups'\r\n"},"comment":{"url":"https://api.github.com/repos/mirumee/saleor/issues/comments/156816281","html_url":"https://github.com/mirumee/saleor/issues/386#issuecomment-156816281","issue_url":"https://api.github.com/repos/mirumee/saleor/issues/386","id":156816281,"user":{"login":"bugeyed","id":3268726,"avatar_url":"https://avatars.githubusercontent.com/u/3268726?v=3","gravatar_id":"","url":"https://api.github.com/users/bugeyed","html_url":"https://github.com/bugeyed","followers_url":"https://api.github.com/users/bugeyed/followers","following_url":"https://api.github.com/users/bugeyed/following{/other_user}","gists_url":"https://api.github.com/users/bugeyed/gists{/gist_id}","starred_url":"https://api.github.com/users/bugeyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bugeyed/subscriptions","organizations_url":"https://api.github.com/users/bugeyed/orgs","repos_url":"https://api.github.com/users/bugeyed/repos","events_url":"https://api.github.com/users/bugeyed/events{/privacy}","received_events_url":"https://api.github.com/users/bugeyed/received_events","type":"User","site_admin":false},"created_at":"2015-11-15T14:59:55Z","updated_at":"2015-11-15T14:59:55Z","body":"This issue also occurs with the default \"deploy to heroku\" app."}}