Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I created one salary rule for seniority(antiquity: Number of days the employee has done in company)
i have the join date (from contract) and today of the employee..
what i want is how many days between that two date.
ie: number of working days between two dates
Please help me.
Using below code you will get number of days.
from datetime import datetime
format = '%Y-%m-%d'
start_date = '2015-12-01' -> Take your date field1
end_date = '2015-12-31' -> Take your date field2
start = datetime.strptime(start_date, format)
end = datetime.strptime(end_date, format)
daysDiff = str((end-start).days) -> will gives you 30 days
daysDiff = str((end-start).days + 1) -> will gives you 31 days
Hope this code help for you !!!
Thanks & Regards,
Ankit H Gandhi.
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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 12/1/15, 3:43 AM|
|Seen: 832 times|
|Last updated: 12/1/15, 6:30 AM|