title: Odoo routes gives "Internal Server Error" error page
body: <p>I'm learning Odoo 11 python developement on Ubuntu by creating a new custom module, from a Youtube video, its code is available on github.</p>
  
  <p>I copied the same project (<a href="https://github.com/mtsoftware2016/Odoo-First-Model" rel="nofollow noreferrer">https://github.com/mtsoftware2016/Odoo-First-Model</a>), everything is working fine except for routes.</p>
  
  <p>controllers.py :</p>
  
  <pre><code>from odoo import http
  
  class MyfirstModel(http.Controller):
      @http.route('/home', auth='public')
      def home(self, **kw):
          return 'Hello world'
  
      @http.route('/example', type='http', auth='public', website=True)
      def render_example_page(self):
          customer = http.request.env['customer'].sudo().search([])
          return http.request.render('myfirst_model.example_page', {'customers': customer})
  </code></pre>
  
  <p>Here the /home route is working, but /example gives this error message on page:</p>
  
  <p><strong>Internal Server Error</strong></p>
  
  <p><em>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</em></p>
  
  <p>Odoo errors log:</p>
  
  <pre><code>2018-10-25 10:33:58,858 4933 INFO odoo3 werkzeug: 127.0.0.1 - - [25/Oct/2018 10:33:58] "GET /example HTTP/1.1" 500 -
  2018-10-25 10:33:58,880 4933 ERROR odoo3 werkzeug: Error on request:
  Traceback (most recent call last):
    File "/home/ubuntu/.local/lib/python3.6/site-packages/werkzeug/serving.py", line 270, in run_wsgi
      execute(self.server.app)
    File "/home/ubuntu/.local/lib/python3.6/site-packages/werkzeug/serving.py", line 258, in execute
      application_iter = app(environ, start_response)
    File "/opt/odoo/odoo/odoo/service/server.py", line 250, in app
      return self.app(e, s)
    File "/opt/odoo/odoo/odoo/service/wsgi_server.py", line 166, in application
      return application_unproxied(environ, start_response)
    File "/opt/odoo/odoo/odoo/service/wsgi_server.py", line 154, in application_unproxied
      result = handler(environ, start_response)
    File "/opt/odoo/odoo/odoo/http.py", line 1318, in __call__
      return self.dispatch(environ, start_response)
    File "/opt/odoo/odoo/odoo/http.py", line 1292, in __call__
      return self.app(environ, start_wrapped)
    File "/home/ubuntu/.local/lib/python3.6/site-packages/werkzeug/wsgi.py", line 766, in __call__
      return self.app(environ, start_response)
    File "/opt/odoo/odoo/odoo/http.py", line 1490, in dispatch
      result = ir_http._dispatch()
    File "/opt/odoo/odoo/addons/web_editor/models/ir_http.py", line 22, in _dispatch
      return super(IrHttp, cls)._dispatch()
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_http.py", line 212, in _dispatch
      return cls._handle_exception(e)
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_http.py", line 182, in _handle_exception
      return request._handle_exception(exception)
    File "/opt/odoo/odoo/odoo/http.py", line 770, in _handle_exception
      return super(HttpRequest, self)._handle_exception(exception)
    File "/opt/odoo/odoo/odoo/http.py", line 310, in _handle_exception
      raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
    File "/opt/odoo/odoo/odoo/tools/pycompat.py", line 87, in reraise
      raise value
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_http.py", line 208, in _dispatch
      result = request.dispatch()
    File "/opt/odoo/odoo/odoo/http.py", line 829, in dispatch
      r = self._call_function(**self.params)
    File "/opt/odoo/odoo/odoo/http.py", line 342, in _call_function
      return checked_call(self.db, *args, **kwargs)
    File "/opt/odoo/odoo/odoo/service/model.py", line 97, in wrapper
      return f(dbname, *args, **kwargs)
    File "/opt/odoo/odoo/odoo/http.py", line 338, in checked_call
      result.flatten()
    File "/opt/odoo/odoo/odoo/http.py", line 1269, in flatten
      self.response.append(self.render())
    File "/opt/odoo/odoo/odoo/http.py", line 1262, in render
      return env["ir.ui.view"].render_template(self.template, self.qcontext)
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_ui_view.py", line 1201, in render_template
      return self.browse(self.get_view_id(template)).render(values, engine)
    File "/opt/odoo/odoo/addons/web_editor/models/ir_ui_view.py", line 27, in render
      return super(IrUiView, self).render(values=values, engine=engine)
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_ui_view.py", line 1210, in render
      return self.env[engine].render(self.id, qcontext)
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_qweb/ir_qweb.py", line 57, in render
      return super(IrQWeb, self).render(id_or_xml_id, values=values, **context)
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 272, in render
      self.compile(template, options)(self, body.append, values or {})
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 345, in _compiled_fn
      raise e
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 343, in _compiled_fn
      return compiled(self, append, new, options, log)
    File "&lt;template&gt;", line 1, in template_236_3
  
    File "&lt;decorator-gen-37&gt;", line 2, in compile
  
    File "/opt/odoo/odoo/odoo/tools/cache.py", line 89, in lookup
      value = d[key] = self.method(*args, **kwargs)
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_qweb/ir_qweb.py", line 77, in compile
      return super(IrQWeb, self).compile(id_or_xml_id, options=options)
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 289, in compile
      element, document = self.get_template(template, options)
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 373, in get_template
      raise QWebException("load could not load template", name=template)
  odoo.addons.base.ir.ir_qweb.qweb.QWebException: None
  Traceback (most recent call last):
    File "/opt/odoo/odoo/odoo/tools/cache.py", line 84, in lookup
      r = d[key]
    File "/opt/odoo/odoo/odoo/tools/func.py", line 68, in wrapper
      return func(self, *args, **kwargs)
    File "/opt/odoo/odoo/odoo/tools/lru.py", line 44, in __getitem__
      a = self.d[obj].me
  KeyError: ('ir.qweb', &lt;function IrQWeb.compile at 0x7f10b987f9d8&gt;, 'website.layout', ('en_US', None, None, None, None, None))
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/opt/odoo/odoo/odoo/tools/cache.py", line 84, in lookup
      r = d[key]
    File "/opt/odoo/odoo/odoo/tools/func.py", line 68, in wrapper
      return func(self, *args, **kwargs)
    File "/opt/odoo/odoo/odoo/tools/lru.py", line 44, in __getitem__
      a = self.d[obj].me
  KeyError: ('ir.model.data', &lt;function IrModelData.xmlid_lookup at 0x7f10ba819620&gt;, 'website.layout')
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_qweb/qweb.py", line 369, in get_template
      document = options.get('load', self.load)(template, options)
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_qweb/ir_qweb.py", line 85, in load
      template = env['ir.ui.view'].read_template(name)
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_ui_view.py", line 1096, in read_template
      return self._read_template(self.get_view_id(xml_id))
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_ui_view.py", line 1108, in get_view_id
      return self.env['ir.model.data'].xmlid_to_res_id(template, raise_if_not_found=True)
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_model.py", line 1343, in xmlid_to_res_id
      return self.xmlid_to_res_model_res_id(xmlid, raise_if_not_found)[1]
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_model.py", line 1334, in xmlid_to_res_model_res_id
      return self.xmlid_lookup(xmlid)[1:3]
    File "&lt;decorator-gen-21&gt;", line 2, in xmlid_lookup
    File "/opt/odoo/odoo/odoo/tools/cache.py", line 89, in lookup
      value = d[key] = self.method(*args, **kwargs)
    File "/opt/odoo/odoo/odoo/addons/base/ir/ir_model.py", line 1323, in xmlid_lookup
      raise ValueError('External ID not found in the system: %s' % xmlid)
  ValueError: External ID not found in the system: website.layout
  
  load could not load template
  Template: website.layout
  </code></pre>
  
  <p>example_page view:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;odoo&gt;
      &lt;template id="example_page" name="Customer Details"&gt;
          &lt;t t-call="website.layout"&gt;
              &lt;center&gt;
                  &lt;h&gt;Customer Details&lt;/h&gt;
              &lt;/center&gt;
          &lt;/t&gt;
      &lt;/template&gt;
  &lt;/odoo&gt;
  </code></pre>
  
  <p>Any suggestions?</p>