Fix grouping by product in document edit form.