<filter string="今日订单" name="today" invisible="0" domain="[('date','=', current_date)]"/>
<filter string="本月订单" name="month" invisible="0" domain="[('date','>=', time.strftime('%Y-%m-01')),('date','<', (context_today() + relativedelta(months=1)).strftime('%Y-%m-01') ) ]"/>
<filter string="上月订单" name="month2" invisible="0" domain="[('date','<', time.strftime('%Y-%m-01')),('date','>=', (context_today() - relativedelta(months=1)).strftime('%Y-%m-01') ) ]"/>
<filter string="本年订单" name="year" invisible="0" domain="[('date','<=', time.strftime('%Y-12-31')),('date','>=', time.strftime('%Y-01-01'))]"/>
【Odoo过滤器中可以使用的时间变量】
- datetime: datetime,
- context_today: context_today,
- time: time,
- relativedelta: relativedelta,
- current_date
最后
以上就是坚定缘分最近收集整理的关于Odoo中本日、本月、上月过滤器实现方法的全部内容,更多相关Odoo中本日、本月、上月过滤器实现方法内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复