Odoo Help

0

Reports Qweb - How to hide the UOM column when the uom is "unit" ?

By
Fabien M
on 3/20/17, 9:14 AM 60 views

Hello,

The UOM column is embarassing in my purchase order reports (and some other reports too).

It can be useful if my products are computed with meters or hours, etc.

But I mostly use the standard unit. And I don't to display "10 unit(s)" each time on my report.

I tried to add in my XML code :

<span t-field="line.product_uom.name" t-if="line.product_uom.name != 'unit'" groups="product.group_uom"/>

But now the column is never displayed, even with the others units of measure.


Do you know how could I solve this issue ?

Thanks a lot,

Regards.

1
Martin Varela
On 3/20/17, 2:06 PM

The default UOM name is 'Unit(s)', try:

<t t-if="line.product_uom.name != 'Unit(s)'">
    <span t-field="line.product_uom.name" groups="product.group_uom"/>
</t>
0
Fabien M
On 3/21/17, 5:22 AM

Thanks a lot ! It works :)

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.

Register

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)

Stats

Asked: 3/20/17, 9:14 AM
Seen: 60 times
Last updated: 3/21/17, 5:22 AM