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 payslip number in a contribution register?

By
Pascal Tremblay
on 1/21/15, 1:36 PM 1,395 views

Hello my friends! 

In the contribution register qweb template, we would want to write the payslip number (from hr.payslip) for each line.

sd

Our PDF report is like this : (see ######)

We have this code in the file report_contributionregister.xml :

                    <table class="table table-condensed">
                        <thead>
                            <tr>
                                <th>Number</th>
                                <th>PaySlip name</th>
                                <th>Code</th>
                                <th>Name</th>
                                <th>Quantity</th>
                                <th>Amount</th>
                                <th>Total</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr t-foreach="get_payslip_lines(o)" t-as="r">
                                <td>
                                    <span>######</span>
                                    <span t-esc="r.get('number')"/>

                                </td>
                                <td><span t-esc="r.get('payslip_name')"/></td>
                                <td><span t-esc="r['code']"/></td>
                                <td><span t-esc="r['name']"/></td>
                                <td><span t-esc="formatLang(r['quantity'])"/></td>
                                <td><span t-esc="formatLang(r['amount'])"/></td>
                                <td><span t-esc=" formatLang(r['total'], currency_obj=o.company_id and o.company_id.currency_id)"/></td>
                            </tr>
                        </tbody>
                    </table>

Could we help please?

 

I have also tried . error.

Pascal Tremblay
on 1/22/15, 6:54 AM
0

Pascal Tremblay

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


Pascal Tremblay
On 1/22/15, 1:55 PM

Oh YEH!

In the file : .../addons/hr_payroll/report/report_contribution_register.py

In the method : _get_payslip_lines()

I have replaced :                

'total': line.total,

By :
             'total': line.total,

 'number': line.slip_id.number,

 

Now, i will create an override in my custom module.

0
isio-odoo
On 1/22/15, 7:05 AM

you can use r.get('id')

Thanks. But you are not right. column is empty. I want the number (2014-PAY-00001) not the id.

Pascal Tremblay
on 1/22/15, 7:10 AM
0

zbik

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


zbik
On 1/22/15, 10:39 AM

Not easy. Will see. Thanks

Pascal Tremblay
on 1/22/15, 10:44 AM

May be I could override the method : def _get_payslip_lines(self, obj): In the class : « class contribution_register_report(report_sxw.rml_parse): » In the file « .../addons/hr_payroll/report/report_contribution_register.py » ???

Pascal Tremblay
on 1/22/15, 11:56 AM

idea ok in old style api.

zbik
on 1/22/15, 12:05 PM

Where is the best documentation about this kind of parser?

Pascal Tremblay
on 1/22/15, 1:17 PM

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/21/15, 1:36 PM
Seen: 1395 times
Last updated: 3/16/15, 8:10 AM