1

i am work on odoo backend and am try to make controller to route web page but am getting this error :

File "C:\Users\urr\server\flectra\http.py", line 316, in _handle_exception raise exception.with_traceback(None) from new_cause ValueError: External ID not found in the system: demp_app.demo_login - - - 2023-08-04 07:41:50,753 1956 INFO demo werkzeug: 127.0.0.1 - - [04/Aug/2023 07:41:50] "GET /service-worker.js HTTP/1.1" 200 - 232 0.109 0.485

i write this controller :

from flectra import  http
from flectra.http import request

class demo_page (http.Controller):
    @http.route('/demo',auth='public',website=True)
    def demo_page(self,**kw):
       # return 'aaaaaaaaaaaaa'
        return request.render("demp_app.demo_login" , {})

and this is my template :

<flectra>
<data>
<template id='demo_login'>
<t t-call='website_template'>

<div class='container'>
eng. ahmed 
</div>

</t>
<data>
</template>
</flectra>

and her my manifest.py file :

# -*- coding: utf-8 -*-
# Part of Odoo, Flectra. See LICENSE file for full copyright and licensing details.

{
    'name': 'demo_app',
    'category': 'Hidden',
    'version': '1.0',
    'description':
        """
            this module is for demo register app 
        """,
    'depends': ['base'],
    'data': [
        'views/demo_template.xml',
    ],
    'qweb': [

    ],
    'bootstrap': True,  # load translations for login screen,
    'license': 'LGPL-3',
}

directory for custom app :

enter image description here

my template didnt have model file because its just for display simple text , the return line include app_name and function name

Anabeil
  • 73
  • 1
  • 11

1 Answers1

0

Make sure your module it's installed and search the template in the views menu to see if it was loaded properly. Maybe you need to run the update of the module again

Also I notice that the data tag wasn't properly closed and also in a bad position. Needs to be like this

<flectra>
<data>
  <template id='demo_login'>
    <t t-call='website_template'>
      <div class='container'>
        eng. ahmed 
      </div>
    </t>
  </template>
</data>
</flectra>
aekis.dev
  • 2,626
  • 1
  • 12
  • 19