Odoo Help


Slectors in javascrip

on 8/12/15, 6:14 AM 397 views

hello evryone;

i want to disply the id location.

this is my code:


<?xml version="1.0" encoding="UTF-8"?>

<templates id="template" xml:space="preserve">

<t t-extend="Product">

<t t-jquery=".product-img" t-operation="append">

<ul class="list">

<t t-foreach="product.locations" t-as="location">

    <li class="list_item" t-att-data-location-id="location[2]">

    <t t-esc="location[0]"/>:<t t-esc="location[1]"/>






<t t-extend="Orderline">

<t t-jquery=".info-list>t:first-child">

this.attr('t-if', "line.get_quantity_str() !== '1' || line.selected || line.get_product().qty_available lt line.quantity ");


<t t-jquery="t[t-esc='line.get_quantity_str()']" t-operation="after">

<t t-set='qty_available' t-value='line.get_product().qty_available'/>

(of <span t-attf-class="qty-info #{qty_available lt line.quantity ? 'not-available':''}"><t t-esc="qty_available"/></span>)






var $elem = $("t-att-data-location-id='"+location_id.id+"'] .list");



Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/12/15, 6:14 AM
Seen: 397 times
Last updated: 8/12/15, 6:14 AM