Odoo Help

Welcome!

This community 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.

0

Slectors in javascrip

By
elalaoui
on 8/12/15, 6:14 AM 343 views

hello evryone;

i want to disply the id location.

this is my code:

pos.xml

<?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]"/>

</li>

</t>

</ul>

</t>

</t>

<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 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>)

</t>

</t>

</templates>

pos.js:


refresh_qty_available:function(product,location_id){

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

console.log("$elem",$elem);

},

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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