Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
8748 มุมมอง

In windows OpenERP 7.0

Filter Based on previous month the below code added [it shows issue]:-

<filter string="Prev Month" name="prev_month" domain="[('data','&gt;=',(context_today()-relativedelta(months=1)).strftime('%%Y-%%m-01')),('data','&lt;',time.strftime('%%Y-%%m-01'))]"/>

In Chrome Browser shows issues:- Uncaught TypeError: Cannot read property 'length' of undefined

In Mozilla Browser show issues:- TypeError: results.group_by is undefined http://localhost:8069/web/webclient/js:3208

Filter Based on Current Date - 90 Days the below code added [its working ]:-

<filter icon="terp-check" string="Data [Today - 90 days]"  domain="[('data', '&gt;=', (context_today() - datetime.timedelta(90)).strftime('%%Y-%%m-%%d') )]"/>

How to solve this issue in filter based on previous month?

Thanks in advance

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

In Reports Filer based on currently year code:-

'year': fields.char('Year', size=4, readonly=True),    

 <filter icon="terp-check" string="Current Year" name="year"  domain="[('year','=',time.strftime('%%Y'))]"/>

How to apply filter by last year in xml file? In python last year code: str(int(time.strftime('%Y'))) -1` the same code in xml file not working how to last year above code convert based on xml file? Thanks in advance

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Adapt this solution to your case: https://accounts.openerp.com/forum/Help-1/question/20731

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ก.ย. 25
246
1
ก.ย. 25
805
1
ส.ค. 25
269
0
ก.ค. 25
1028
0
ก.ค. 25
448