【发布时间】:2021-02-25 14:00:36
【问题描述】:
我正在尝试为登录和注册提供 OTP 服务。所以我为 otp 服务制作了一个运行良好的模块。但是在这里对于 UI,我制作了应该在登录页面内调用的模板以显示 otp 框和 otp 发送按钮。请参阅下面的示例代码:
<templates xml:space="preserve">
<div name="otp_service" t-name="bulk_sms_otp_service.otp_service">
<h1>Hello world</h1>
</div>
</templates>
现在我正在尝试在登录视图中调用此模板。请看下文:
<odoo>
<template id="custom_login" name="Custom login" inherit_id="web.login">
<xpath expr="//p[hasclass('alert-success')]" position="after">
<t t-call="bulk_sms_otp_service.otp_service"/>
</xpath>
</template>
</odoo>
但是这个调用不起作用。给我一个错误,例如:
External id "bulk_sms_otp_service.otp_service" not found
我不知道我的代码有什么问题,或者我错了。请帮我解决这个问题。
【问题讨论】:
标签: python-3.x odoo odoo-11 odoo-12