'Return the view ID corresponding to ``template``, which may be a
view ID or an XML ID. Note that this method may be overridden for other
kinds of template values.'

@api.model
def get_view_id(self, template):

    if isinstance(template, (int, long)):
        return template
    if ('.' not in template):
        raise ValueError(('Invalid    template    id:    %r' % template))
    return self.env['ir.model.data'].xmlid_to_res_id(template, raise_if_not_found=True)
