Domain inversion for child_of does not work when the domain use a reference field.
We stumbled upon a domain on timesheet.line writen like this:
[[u'work.origin.parent', u'child_of', [663], u'project.work']]
When the domain inversion for the field 'work' is triggered it results in the following domain:
[[u'project.work', u'child_of', [663]]]
Which can not work.
The solution is to check in inverse_leaf the number of dots in case of inversion of a child_of.
If there's more than one dot than we just need to remove the local part otherwise we keep it.
Reference field must also be modified to support to take into account the child_of case and prepare the domain in domain_get.