如何解决当月过滤器无法正常工作
嗨,我试过这样
1.<filter string="Current Month"
domain="[('appointment_sdate','<=',(context_today() + relativedelta(months=1)).strftime('%%Y-%%m-01 00:00:00')),('appointment_sdate','>=',time.strftime('%%Y-%%m-01'))]"/>
2.domain="[('appointment_sdate',(context_today() + relativedelta(months=1)).strftime('%%Y-%%m-01 +05:30:00')),time.strftime('%%Y-%%m-01'))]"
appointment_sdate 是日期时间字段。
两种方法都可以显示当前月份的值以及下个月第一天上午 12:00 至凌晨 5:30 的附加值。
有人知道如何避免过滤器中的 this 吗?
我正在使用
日期格式:%d/%m/%Y
时间格式:%I:%M:%s %p
我也这样试过,结果一样。
domain="[('appointment_sdate',context_today().strftime('%%Y-%%m-01')),'<',(context_today()+relativedelta(months=1)).strftime('%%Y-%%m-01'))]"
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。