'Check whether all fields in dependencies are valid.'

@api.constrains('depends')
def _check_depends(self):

    for record in self:
        if (not record.depends):
            continue
        for seq in record.depends.split(','):
            if (not seq.strip()):
                raise UserError((_('Empty    dependency    in    %r') % record.depends))
            model = self.env[record.model]
            names = seq.strip().split('.')
            last = (len(names) - 1)
            for (index, name) in enumerate(names):
                field = model._fields.get(name)
                if (field is None):
                    raise UserError((_('Unknown    field    %r    in    dependency    %r') % (name, seq.strip())))
                if ((index < last) and (not field.relational)):
                    raise UserError((_('Non-relational    field    %r    in    dependency    %r') % (name, seq.strip())))
                model = model[name]
