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

How can I remove the product_id under the product description on the report_saleorder_document?

By
Jason Wu
on 12/19/14, 2:23 AM 1,144 views

Please help ...

<tbody class="sale_tbody">
                    <tr t-foreach="o.order_line" t-as="l">
                       <td>
                            <span t-field="l.name" />     
                        </td>

 

l.name include product_id .how can format ? i only want product  description 

Can you post the detailed info about this please. Because i have checked this, It is displaying correctly for me...

Rajiv
on 12/20/14, 5:32 AM

I can not post pictures of information, karma is not enough Structure can only express in words on my report sales.order.line information: product description [iMac] [iMac] 16G,White,Wifi, i don't want [iMac] on description !!

Jason Wu
on 12/20/14, 12:15 PM
2

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 12/20/14, 7:05 AM

Line name include "Internal Reference" = default_code from product (not product_id). If you want to change it you need to override method name_get() from product.product. Another way is to set the display_default_code = False in context. The easiest way is to replace the line <span t-field="l.name" />  and insert

<span t-esc="l.name[l.name.find('] ')+2:]"/>  

will cut the string to chars '] '

 

0
Laurent ROCHE
On 6/11/15, 10:34 AM


I've replaced the line

<span t-field="l.name" />

by

<span t-esc="l.name[l.name.find('] ')+2:]"/>

That works ... nearly: the line break in my sales description are removed.

I don't know what to do to get this working. I would like to "set the display_default_code = False in context " ... but I don't know how.

I am using the Saas version so it's unlikely I am able to override method name_get() from product.product.

Hopefully, someone will have a solution for me.

Cheers.

0
Jason Wu
On 12/21/14, 7:51 PM

zbik

 

Thank you for your answer, I have followed your way to complete the correction.

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

3 follower(s)

Stats

Asked: 12/19/14, 2:23 AM
Seen: 1144 times
Last updated: 6/11/15, 11:51 AM