Odoo Help

Welcome!

This community 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.

0

Filter based on previous month issue

By
Prakash
on 6/19/13, 11:47 AM 3,046 views

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

0

Prakash

--Prakash--
3173
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
On 6/26/13, 8:39 AM

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

0

Francesco OpenCode

--Francesco OpenCode--
3608
| 5 7 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 6/24/13, 12:43 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 6/19/13, 11:47 AM
Seen: 3046 times
Last updated: 3/16/15, 8:10 AM