<filter string="今日订单" name="today" invisible="0" domain="[('date','=', current_date)]"/>
<filter string="本月订单" name="month" invisible="0" domain="[('date','&gt;=', time.strftime('%Y-%m-01')),('date','&lt;',  (context_today() + relativedelta(months=1)).strftime('%Y-%m-01') ) ]"/>
<filter string="上月订单" name="month2" invisible="0" domain="[('date','&lt;', time.strftime('%Y-%m-01')),('date','&gt;=',  (context_today() - relativedelta(months=1)).strftime('%Y-%m-01') ) ]"/>
<filter string="本年订单" name="year" invisible="0" domain="[('date','&lt;=', time.strftime('%Y-12-31')),('date','&gt;=', time.strftime('%Y-01-01'))]"/>

【Odoo过滤器中可以使用的时间变量】

  • datetime: datetime,
  • context_today: context_today,
  • time: time,
  • relativedelta: relativedelta,
  • current_date

原文地址:https://www.zhiyunerp.com/forum/erp-1/question/odoo-354

Odoo中本日、本月、上月过滤器实现方法的更多相关文章

  1. Odoo中的五种Action详解

    转载请注明原文地址:https://www.cnblogs.com/ygj0930/p/10826232.html Odoo中的五种action都是继承自ir.actions.actions模型实现的 ...

  2. 在Winform开发中使用日程控件XtraScheduler(2)--深入理解数据的存储

    在上篇随笔<在Winform开发中使用日程控件XtraScheduler>中介绍了DevExpress的XtraScheduler日程控件的各种使用知识点,对于我们来说,日程控件不陌生,如 ...

  3. 怎样实现了捕获应用中的日志在android开发中

    怎样实现了捕获应用中的日志在android开发中,大家可研究一下. Process mLogcatProc = null; BufferedReader reader = null; try { mL ...

  4. 利用Python的三元表达式解决Odoo中工资条中城镇、农村保险的问题

    Python中没有像C#中有三元表达式 A?B:C 但在python中可以通过 A if condition else B 的方式来达到同样的效果. 例如 : 1 if True else 0 输出 ...

  5. (19)odoo中的javascript

    -----------更新日期15:17 2016-02-16 星期二-----------* 用到的js库   我们可以打开 addons/web/views/webclient_template. ...

  6. Odoo 中使用 celery 实现高性能异步任务队列

    详见:http://www.oejia.net/blog/2018/07/09/odoo_task_queue.html 概述 在 odoo 中可以用自带的cron实现异步任务,这个cron基于多线程 ...

  7. odoo中def init(self):

    # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. f ...

  8. odoo中self的使用

    一:self是什么 目前新版的Odoo中使用到的self,是对  游标cr.用户ID.模型.上下文.记录集.缓存  的封装. 我们可以通过 self.XX 获取到这些封装的东西,比如:self.cr. ...

  9. odoo中的ORM操作

    ORM方法简介 OpenERP的关键组件, ORM是一个完整的对象关系映射层,是开发人员不必编写基本的SQL管道. 业务对象被声明继承字models.Models的python类. 这让业务对象在OR ...

随机推荐

  1. [原创]Linq to xml增删改查Linq 入门篇:分分钟带你遨游Linq to xml的世界

    本文原始作者博客 http://www.cnblogs.com/toutou Linq 入门篇(一):分分钟带你遨游linq to xml的世界 本文原创来自博客园 请叫我头头哥的博客, 请尊重版权, ...

  2. Shell入门教程:流程控制(7)break和continue

    第一节:breank命令 4种循环 for.while.until.select,如果想要提早结束循环,可在循环中使用break命令.执行break时,会跳出一层的循环,如果想跳出多层循环,可在bre ...

  3. 聊聊Azure的安全性

    本来没打算写这篇博文,毕竟感觉太理论化,不像做技术的人应该写的东西,但是作为一名售前,发现很多不了解Azure的客户,上来的第一个问题竟然就是Azure如何保证客户数据的安全性,我清楚记得我第一次被问 ...

  4. C和指针 第六章 习题

    6.1编写一个函数,它在一个字符串中进行搜索,查找所有在一个给定字符集中出现的字符,返回第一个找到的字符位置指针,未找到返回NULL #include <stdio.h> char * f ...

  5. jquery.roundabout.js图片叠加3D旋转插件多功能图片翻转切换效果

    http://www.17sucai.com/pins/4880.html DEMO演示地址:http://www.17sucai.com/pins/demoshow/4880

  6. Wireshark抓包工具

    首先下载并安装Wireshark软件,最好选择中文版,因为会使你用的更顺手. 安装完毕之后,双击打开Wireshark软件,主界面还是比较清晰明了的,可是怎么用还是稀里糊涂的吧. 点击菜单栏红圈中的选 ...

  7. jq 实现无限级地区联动 样式为bootstrap

    HTML 部分 <div class="row" style="margin:100px auto;"> <form method=" ...

  8. Ubuntu远程vnc配置

    1. 安装xrdp 使用快捷键"Ctrl+Alt+T"打开一个终端窗口,输入"sudo apt-get install xrdp"-->回车-->输 ...

  9. HTML文档、javascript脚本的加载与解析

    1.onload事件 1.1 onload事件分类 a.文档加载完成事件(包括脚本.图片等资源都加载完),绑定方法:<body onload="doSomething()"& ...

  10. Palindrome Number

    Determine whether an integer is a palindrome. Do this without extra space. public class Solution { p ...