Skip to Content
Menú
This question has been flagged
1 Respondre
1720 Vistes

I want to calculate a payslip basis on the worked days & the hourly wage.


I've tried this command 

'result = contract.x_studio_transport_allowance * (contract.ressource_calendar_id/contract.full_time_required_hours)


But i've this message 

Code python incorrect défini pour la règle de salaire Prime de transport (ITRP). Erreur : : "'hr.contract' object has no attribute 'ressource_calendar_id'" while evaluating 'result = contract.x_studio_transport_allowance * (contract.ressource_calendar_id/contract.full_time_required_hours)\n'

Avatar
Descartar
Autor Best Answer

The error message indicates that the 'hr.contract' object doesn't have an attribute named 'ressource_calendar_id'. In the formula you are trying to divide the 'ressource_calendar_id' by the 'full_time_required_hours'. If you want to calculate the number of worked days, you need to access the 'resource_calendar_id' instead of 'ressource_calendar_id' and divide it by the number of required hours.

Here is the corrected formula:

result = contract.x_studio_transport_allowance * (contract.resource_calendar_id/contract.full_time_required_hours)

Note that this formula only gives you the amount of transport allowance for a single day. To calculate the total transport allowance for the entire payslip period, you will need to multiply this amount by the number of worked days during that period.

Avatar
Descartar
Related Posts Respostes Vistes Activitat
0
de des. 23
800
0
de des. 22
1322
1
de des. 18
3431
2
de nov. 18
5782
2
de març 15
8576