zoukankan      html  css  js  c++  java
  • Odoo中本日、本月、上月过滤器实现方法

    <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

  • 相关阅读:
    python爬取图片
    IDEA创建SpringBoot项目报错,不能连接https://start.spring.io/
    ES模块化的理解
    Web标准(网站标准)理解
    Mongodb安装
    Linux Ntp时间同步服务
    SentinelResource 注解
    Sentinel的流量控制
    Sentinel简介
    nacos安装
  • 原文地址:https://www.cnblogs.com/kfx2007/p/6008508.html
Copyright © 2011-2022 走看看