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 am using following code for compute next week filter, It does correct computation on python terminal but in filter it gives no result
<filter string = "Next Week" domain="[( 'date_deadline', '>=', (context_today() + relativedelta(weeks=0, weekday=0)).strftime('%Y-%m-%d')) , ( 'date_deadline', '<', (context_today() + relativedelta(weeks=1, weekday= 0, days = 6)).strftime('%Y-%m-%d') )]" />
You define computed field next_mondy_start and next_mondy_end and use them as domain filter.
In my test system, this example, with stored fields, filter works without any problem:
self.start = fields.Datetime.from_string(fields.Datetime.now()) + relativedelta(weeks=0, weekday=0)
self.stop = fields.Datetime.from_string(fields.Datetime.now()) + relativedelta(weeks=0, weekday= 0, days = 6)
self.test_dt = self.stop > self.test > self.start
test = fields.Datetime('Date Test')
test_dt = fields.Boolean('Test dt',compute='_get_dates',store=True)
start = fields.Datetime('Start',compute='_get_dates',store=True)
stop = fields.Datetime('Stop',compute='_get_dates',store=True)
PS. start and stop fields are unnecessary
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 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: 2/16/15, 9:44 PM|
|Seen: 1161 times|
|Last updated: 9/3/15, 3:15 PM|