Odoo Help


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

Vale Trood
on 11/24/15, 6:14 AM 1,170 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
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..!


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

Vale Trood
on 11/25/15, 8:08 AM

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.


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)


Asked: 11/24/15, 6:14 AM
Seen: 1170 times
Last updated: 11/28/15, 6:59 AM