Set idx while adding communication. Fixes frappe/erpnext#1645