Correctly guess invoice line type in on_change_product

issue4230
review8601003