تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
3341 أدوات العرض

I need to extract month from invoice_date as a custom Character or selection field (NO DATE).

Thanks

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

Please try like this:- 

import datetime
month = datetime.strptime(self.date_invoice, '%Y-%m-%d').strftime("%B")

It will return the month name.

Regards

الصورة الرمزية
إهمال
الكاتب

I forgot to comment that I would like to do it in the frontend, directly in the web as a custom field x_MONTH. And in the model invoice.account.report

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
نوفمبر 22
3778
1
يوليو 22
2363
3
نوفمبر 21
26016
1
أغسطس 15
5525
2
مارس 15
5277