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 to display only the last amount on the payslip?

By
Pascal Tremblay
on 1/11/15, 2:14 PM 1,333 views

Hello all,

In this payslip, how to display only the last amount of 751,83 $ in the section « Salaire net : »????

Here is my template code for this section :

                        <div class="col-xs-4" style="">
                            <h4>
                                <strong>Net pay :</strong>
                            </h4>
                            <div style="margin-left: 20px;">
                                <div t-foreach="get_payslip_lines(o.line_ids)" t-as="p">
                                    <span t-esc="formatLang(p.amount, currency_obj=o.company_id.currency_id)" />
                                    <span t-esc="formatLang(p.total, currency_obj=o.company_id.currency_id)" />
                                </div>
                            </div>
                            <br />
                        </div>

 

What do you think about that? Idea?

 

 

 

 

 

 

 

1

zbik

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


zbik
On 1/12/15, 10:19 AM

Try print only the last line:

<div t-foreach="get_payslip_lines(o.line_ids)" t-as="p">
<t t-if="p_index + 1 == len(get_payslip_lines(o.line_ids))">
    <span t-esc="formatLang(p.amount, currency_obj=o.company_id.currency_id)" />
    <span t-esc="formatLang(p.total, currency_obj=o.company_id.currency_id)" />
</t>
</div>

or identify line by p.salary_rule_id.code = 'NET'

Thanks a lot! I'm happy. You had two typos. They are corrected.

Pascal Tremblay
on 1/12/15, 7:32 PM
0

Pascal Tremblay

--Pascal Tremblay--
1312
| 5 2 7
Alma, Canada
--Pascal Tremblay--


Pascal Tremblay
On 1/12/15, 7:34 PM

great!

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: 1/11/15, 2:14 PM
Seen: 1333 times
Last updated: 3/16/15, 8:10 AM