Check invoice line origin has the same category of unit of measure
Reference https://discuss.tryton.org/t/sales-status-waiting-invoice-status-payed/4303
I do not think a domain is doable because it is a Reference field but a validation on save could ensure that. I do not think it is a major UX issue because common usage does not require the user to set the origin of an invoice line.