I need to add total number of days of month (30 or 31) in a salary rule python code . How can i do that? result=-(contract.wage/30)*worked_days.Unpaid.number_of_days
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilité
- Inventaire
- PoS
- Project
- MRP
Cette question a été signalée
You want to create a working schedule for each employee.
Human resource->Contract->working schedule
Then automatically get the total no.of days for each employee.
Python code::::
datej = str(payslip.date_to)
datek = str(payslip.date_from)
dj = datej[-2:]
x=0
new = 0
while (x<=31):
x= x+1
if str(x) == dj or "0"+str(x) == dj:
new= x
dk = datek[-2:]
y=0
old = 0
while (y<=31):
y= y+1
if str(y) == dk or "0"+str(y) == dk:
old= y
no_of_days = new-old + 1
result = no_of_days
How i can get the date differece in days in salary rule (not only for current month)? and how i can know about the days of month with date for example 28 days in Feb, 31 days in Jan etc.
I add this code to my salary rule. But while creating payslip, it shows 'python error'. Please correct me.
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrirePublications associées | Réponses | Vues | Activité | |
---|---|---|---|---|
|
0
mai 22
|
2279 | ||
|
1
mai 22
|
2100 | ||
|
1
janv. 22
|
1845 | ||
|
1
oct. 21
|
14013 | ||
Shift Working Schedule
Résolu
|
|
6
janv. 24
|
15732 |