Skip to Content
Menu
This question has been flagged
2 Replies
2014 Views

result = hr.payslip.date_from

result = hr.contract.date_start

Avatar
Discard
Best Answer

Hey As Geor,

Here is the solution of your problem:

result = payslip.date_from
result = contract.date_start

When any salary rule is defined in odoo as a python code, need to follow this variables for the access of particular object:

# Available variables:
#----------------------
# 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.  

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Discard
Author Best Answer

Hay Jainesh Shah,

result = payslip.date_from
result = contract.date_start 

returns against "wrong python code defined for salary rule ..."

May bee a conversion of date type object to number is needed? A function like datevalue in Excel?

My idea is to calculate in Payroll the employees years of service.


Avatar
Discard