Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
5561 Переглядів

 I try to call a JS function from my qweb im_chat.xml template via:

<t t-name="im_chat.Conversation_content">
   <t t-foreach="_.keys(list)" t-as="date">
    <div class="oe_im_chatview_date_separator">
    <!--<t t-esc="Date.parse(date).toString(Date.CultureInfo.formatPatterns.longDate)"/>-->
    <t t-esc="ToShamsi(parseInt('2015'), parseInt('8'), parseInt('22'), 'Long')"/>
    </div>
    <t t-foreach="list[date]" t-as="bubble">
    <t t-if="bubble[0].type === 'message'">
    <t t-call="im_chat.Conversation_message_bubble">
    <t t-set="messages" t-value="bubble"/>
    </t>
    </t>
    <t t-if="bubble[0].type === 'meta'">
    <t t-call="im_chat.Conversation_technical_bubble">
    <t t-set="messages" t-value="bubble"/>
    </t>
    </t>
    </t>
    </t>
</t>


my js file include:

function ToShamsi(grgYear,grgMonth,grgDay,Format)

{

  [...]

}

but odoo show me this error"

     Uncaught TypeError: undefined is not a function 

any suggestions?

Thank Before.

Аватар
Відмінити
Автор

Uncaught Error: QWeb2 - template['im_chat.Conversation_content']: Runtime Error: TypeError: dict.Toshamsi is not a function

Найкраща відповідь

I'm guessing my js function is not being defined, thus giving "'NoneType' object is not callable" error.

Tried writing it in my custom.js, which is working fine and inside the qweb. None works.

Can anybody help, please? I've been stuck on this for a whole month. :(

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
квіт. 15
4690
0
жовт. 24
1186
1
лип. 25
364
0
лип. 25
401
1
трав. 25
893