Bugfix for has_stock_record

Stockrecord can be None if loaded with select_related.

Fixes #648
Fixes #690