Please check this:
Update: although Uom is not set automatically, a user may define only a Uom supported by a current device_class.