Dunning reference is always empty
The email and letter use the record name of the line's origin. But in most case like for an invoice, the dunned line has no origin because the invoice set itself as move's origin (and only the other lines are linked to the invoice's lines). So for me we should use the move origin if the line origin is empty (like that the invoice record name will be used).