This question has been flagged
2 Replies
7455 Views

I'm trying to set up a way to adjust the search custom filters when i'm on the contacts list page. How can I get the currently active model name within a <t-if> statement?

Avatar
Discard
Best Answer

In the qweb report, try like this one:

t-if="doc_model=='account.invoice'"

In the qweb template, if active_model exist in context:

t-if="request.context.get('active_model')=='account.invoice'"

Avatar
Discard
Author

Uncaught Error: QWeb2 - template['SearchView.extended_search.proposition']: Runtime Error: TypeError: Cannot read property 'context' of undefined

Demonstrate exactly what you want to do.

Best Answer

use this :

 <span t-esc="o._name"/>

also you can use this on if condition:

<t t-if='o._name == sale.order'>

</t>

Avatar
Discard
Author

Uncaught Error: QWeb2 - template['SearchView.extended_search.proposition']: Runtime Error: TypeError: Cannot read property '_name' of undefined