how can we increase the number of months of a date with a value in a function !! please heeelp
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
Hi,
from datetime import datetime
from dateutil.relativedelta import relativedelta
def _add_month_date(self, date_octroi,nbr_echeance) :
date_before_month = datetime.strptime(date_octroi, '%Y-%m-%d')
date_after_month = date_before_month+ relativedelta(months=nbr_echeance)
return date_after_month
This function takes as parameters your date and number of months and add return months to this date then return a new date.
thanks.
Thank you so so much for your reply and sorry if I was'nt too clear.. But I want to say that I have already a "date_octroi" for which I need to increase the number of months with the value of the number of deadlines "nbr_echeance"... how can i do it !! please i need your help thanks a lot
I edit my answer it is clear now.
yes it's so perfect thank you so much :-)
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
How to make tree of dictionary?
تم الحل
|
|
1
يناير 24
|
4345 | |
|
1
مارس 15
|
3740 | ||
|
1
مارس 15
|
31620 | ||
|
0
يناير 20
|
3628 | ||
|
0
يونيو 19
|
3304 |