frappe/frappe#478 fixes
Merge branch 'model-cleanup' of github.com:frappe/erpnext into model-cleanup