Odoo Help

0

How to display only the last amount on the payslip?

By
Pascal Tremblay
on 1/11/15, 2:14 PM 1,553 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
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
On 1/12/15, 7:34 PM

great!

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