Show invalid_record.rec_name or similar in the DomainValidationError msg


Sometimes (at least in my case) I get a DomainValidationError while importing data (multiple records). In this case not knowing the value of the field that caused the error means that I have to a) debug or b) perform a kind of dichotomy search by hand on the imported data.


When I debug this kind of error (after the final user contacts me). I just print the invalid record or put a trace to find out the value of invalid_record (.rec_name or id).


I don’t know if it would be feasible to add this info (invalid_record.rec_name) to the message on DomaniValidationError.

Already discussed on Issue 5581: Improve validate error messages - Tryton issue tracker