Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.92 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <odoo>
  3.     <data>
  4.  
  5.         <record id="view_inherit_sale_report_filter" model="ir.ui.view">
  6.             <field name="name">sale.report.search.inherit</field>
  7.             <field name="model">sale.report</field>
  8.             <field name="inherit_id" ref="sale.view_order_product_search"/>
  9.             <field name="arch" type="xml">
  10.                 <xpath expr="//group" position="before">
  11.                     <separator />
  12.  
  13.                     <filter string="Yerterday sales" name="yesterday_sales" domain="[('date','&gt;=',((context_today()-datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d'))),('date','&lt;=' , (context_today()-datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d'))]" help="yesterday sales."/>
  14.  
  15.                     <filter string="Today sales" name="today_sales" domain="[('date','&gt;=',((context_today()).strftime('%%Y-%%m-%%d'))),('date','&lt;=' , (context_today()).strftime('%%Y-%%m-%%d'))]" help="today sales."/>
  16.  
  17.                     <filter string="Last Month sales" name="last_month_sales" domain="[('date','&gt;=',(context_today()-relativedelta(months=1)).strftime('%%Y-%%m-01')),('date','&lt;',time.strftime('%%Y-%%m-01'))]" help="last month sales."/>
  18.  
  19.                     <filter string="This month sales" name="this_month_sales" domain="[('date','&lt;=',(context_today()+relativedelta(day=31)).strftime('%%Y-%%m-%%d')),('date','&gt;=',(context_today()-relativedelta(day=1)).strftime('%%Y-%%m-%%d'))]" help="this month sales." />
  20.  
  21.                     <filter name="first_quarterly_sales" string="First Quarterly sales" domain="[('date','&lt;=', time.strftime('%%Y-03-31')),('date','&gt;=',time.strftime('%%Y-01-01'))]"/>
  22.  
  23.                     <filter name="second_quarterly_sales" string="Second Quarterly sales" domain="[('date','&lt;=', time.strftime('%%Y-06-30')),('date','&gt;=',time.strftime('%%Y-04-01'))]"/>
  24.  
  25.                     <filter name="thirth_quarterly_sales" string="Thirth Quarterly sales" domain="[('date','&lt;=', time.strftime('%%Y-09-30')),('date','&gt;=',time.strftime('%%Y-07-01'))]"/>    
  26.  
  27.                     <filter name="Fourth Quarterly sales" string="Fourth Quarterly sales" domain="[('date','&lt;=', time.strftime('%%Y-12-31')),('date','&gt;=',time.strftime('%%Y-10-01'))]"/>
  28.  
  29.                     <filter string="Last Year sales" name="last_year_sales" domain="[('date','&gt;=',(context_today()-relativedelta(years=1)).strftime('%%Y-01-01')),('date','&lt;',time.strftime('%%Y-01-01'))]" help="last year sales." />
  30.  
  31.                     <filter string="This Year sales" name="this_year_sales" domain="[('date','&lt;=', time.strftime('%%Y-12-31')),('date','&gt;=',time.strftime('%%Y-01-01'))]" help="this year sales." />
  32.  
  33.                     <filter string="Past sales" name="past_sales" domain="[('date','&lt;',((context_today()).strftime('%%Y-%%m-%%d')))]" help="past sales."/>
  34.  
  35.                 </xpath>
  36.             </field>
  37.         </record>
  38.  
  39.     </data>
  40. </odoo>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement