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.

1

How to call a salary rule to calculate a specific field in python?

By
Drees Far
on 11/24/15, 6:14 AM 478 views

Hello everybody!!!!!!!

Please, i want to ask you i have a field in OpenERP.

And i want to know how can i call a salary rule that i have created to calculate a field that i will specify for my report.

Thanks a lot in advance.

Best Regards.


Hello Drees, if you want to call a salary rule from a payslip, just go though get_payslip_lines() method, in that you can traverse salary rule. Hope this helps.

Kalpana Hemnani
on 1/7/16, 8:15 AM
0
Kalpana Hemnani
On 11/25/15, 6:20 AM

Hello Drees,

You can use below variables in your salary rule:

payslip: object containing the payslips

employee: hr.employee object

contract: hr.contract object

rules: object containing the rules code (previously computed)

categories: object containing the computed salary rule categories (sum of amount of all rules belonging to that category).

worked_days: object containing the computed worked days

inputs: object containing the computed inputs

These variables will work as a browse record for respective object.

For example,

if you want to access employee from payslip, you just have to define payslip.employee_id.

Hope this helps..!

Regards,

Kalpana Hemnani

hi my friend :) thx a lot for your answer but what i want to know is how can i call a salary rule into a function and i will give it a specific field to work on its value plz

Drees Far
on 11/25/15, 8:08 AM

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: 11/24/15, 6:14 AM
Seen: 478 times
Last updated: 11/28/15, 6:59 AM