Auto generate unique product code if not provided

http://manage.dimagi.com/default.asp?121783
@mrgriscom would be proud