Odoo Help

0

1
8 Antwoorden
2

@Luke, I found a response from you for a similar question (\source)

Now I'm printing the image in the QWeb report this way:

<span t-field="product_id.image_small" t-field-options="{&quot;widget&quot;: &quot;image&quot;, &quot;class&quot;: &quot;img-rounded&quot;}"/>

Thank you!

1 Opmerking
DevBranch Company Limited, Luke Branch Hong Kong
17-12-14 22:16

@Alejandro, no problem, i'm glad it helped.

0
Avatar

kirubanidhi India

--kirubanidhi--

5066
| 6 2 8
pondicherry, India
--kirubanidhi--


kirubanidhi India
13-06-16 08:57

Hello Alejandro Perez Cosio,

     In  my code is working fine, 
Staff_id is a many2one fields. Staff_image field is having staff table. Im accessing a field from staff table image field into my student table.
doc.staff_id.staff_image


<div class="col-xs-4 col-xs-offset-3">

            <strong text-align="right">Staff Image</strong>

            <span t-field="doc.staff_id.staff_image"

t-field-options='{"widget": "image","class": "oe_avatar"}' />

</div>

0
Avatar

Pascal Tremblay Canada

--Pascal Tremblay--
1944
| 6 4 10
Amos, Canada
--Pascal Tremblay--


Pascal Tremblay Canada
18-12-14 08:30

Look at this...

in report_purchasequotation_document, I can get image with code :

            <h2>Request for quotation : N° <span t-field="o.name"/></h2>
            <table class="table table-condensed">
                <thead>
                    <tr>
                        <th class="text-left"><strong>   Picture</strong></th>
                        <th class="text-left"><strong>Description</strong></th>
                        <th class="text-center"><strong>Expected date</strong></th>
                        <th class="text-right"><strong>Quantity</strong></th>
                    </tr>
                </thead>
                <tbody>
                    <tr t-foreach="o.order_line" t-as="order_line">
                        <td>
                             <span t-field="order_line.product_id.image_small" t-field-options="{&quot;widget&quot;: &quot;image&quot;, &quot;class&quot;: &quot;img-rounded&quot;}"/>
                        </td>
                        <td>
                             <span t-field="order_line.name"/>
                        </td>
                        <td class="text-center">
                                <p t-field="order_line.date_planned" t-field-options='{"format": "d MMMM y"}'/>
                        </td>
                        <td class="text-right">
                            <span t-field="order_line.product_qty"/>
                            <span t-field="order_line.product_uom" groups="product.group_uom"/>
                        </td>
                    </tr>
                </tbody>
            </table>

 

In report_saleorder_document, I can NOT get image with code :

            <table class="table table-condensed">
                <thead>
                    <tr>
                        <th> Picture</th>
                        <th>Description</th>
                        <th>Taxes</th>
                        <th class="text-right">Quantity</th>
                        <th class="text-right">Unit price</th>
                        <th groups="sale.group_discount_per_so_line">Disc.(%)</th>
                        <th class="text-right">Price</th>
                    </tr>
               </thead>
               <tbody class="sale_tbody">
                    <tr t-foreach="o.order_line" t-as="l">
                        <td>
                           <span t-field="l.product_id.image_small" t-field-options="{&quot;widget&quot;: &quot;image&quot;, &quot;class&quot;: &quot;img-rounded&quot;}"/>
                        </td>
                        <td><span t-field="l.name"/>
                       </td>
                        <td>
                            <span t-esc="', '.join(map(lambda x: x.name, l.tax_id))"/>
                        </td>
                        <td class="text-right">
                            <span t-field="l.product_uom_qty"/>
                            <span groups="product.group_uom" t-field="l.product_uom"/>
                        </td>
                        <td class="text-right">
                            <span t-field="l.price_unit"/>
                        </td>
                        <td groups="sale.group_discount_per_so_line">
                            <span t-field="l.discount"/>
                        </td>
                        <td class="text-right">
                            <span t-field="l.price_subtotal" t-field-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: &quot;o.pricelist_id.currency_id&quot;}"/>
                        </td>
                    </tr>
                </tbody>
            </table>

 

Do you see the problem guy?

Stel een vraag
Blijf op de hoogte
3 volger(s)
Over deze 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.

Register
Odoo Training Center

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

Test it now