Odoo Help

0

How to add unit price after discount to sales order report?

By
Simon
on 12/11/14, 9:05 AM 1,181 views

How to operate with fields in reports? I would like to add own column with unit price after discount. 

This is the way, how it doesnt work, but I am sure you know what i am trying to do here:

                        <td class="text-right">
                            <span t-field="l.price_unit*(1-l.discount)"/>
                        </td>

Thanks for any help

2

Zbik

--Zbik--
6760
| 6 5 7
Lodz, Poland
--Zbik--


Zbik
On 12/11/14, 10:15 AM

You use: t-esc

<span t-esc="l.price_unit*(1-l.discount)"/>

1
Simon
On 12/11/14, 11:30 PM

It works, thank you!

Just note for others: value of discount is not stored in %, so it should be like this  

<span t-esc="l.price_unit*(1-l.discount/100)"/>

0
Melekeddine Sahli
On 3/13/18, 6:26 AM

Thank you !! it worked wonderfully.

For those who are novices with odoo like me here's a step by step on how to add it. Using odoo 11.0

1) go to settings and activate developer mode > then reports > reports https://i.imgur.com/uJactI5.jpg

2) after that on the search bar type "sale.order" and then click on the model "sale.report_saleorder"
3)click on qweb view, it has the icon " </> "

4) Click on "report_saleorder_document" and then modify.
5) search for this and add this line,you can name it anything https://i.imgur.com/SpsBgrc.jpg

6) now go here and add this line and click save https://i.imgur.com/tufytGY.jpg

now export your PDF reports and they'll include the unit price after discount.


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: 12/11/14, 9:05 AM
Seen: 1181 times
Last updated: 3/13/18, 6:26 AM