Check validity of existing records

When we update a database to a new Tryton version, it may happen that the new version added new checks or constraints on some models, e.g. the phone number validation of contact mechanism.
It is then required to the user to fix to fix the wrong data. But it can be difficult to find those failing records.
I propose to add on trytond-admin an option to execute validate on existing records. There should be an option to define which the model names (all if empty) and another option to define the percentage of records to test (all if empty). The command will report the ID, record name and validation error for each record that is failing.

What do you think?

I like the idea but there should probably a mechanism that later eases end users to apply a filter that shows those records.

So I wonder if it should not be a tool in the Administration section.

I do not think you should run this on production database.
For me it is a tool used during the migration to prepare the existing data.

Sounds really useful! +1