Skip to content

Commit

Permalink
add various date filters in important views
Browse files Browse the repository at this point in the history
  • Loading branch information
ged-odoo committed Jun 15, 2018
1 parent 92e70d3 commit fac3bfa
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
3 changes: 1 addition & 2 deletions addons/crm/report/crm_activity_report_views.xml
Expand Up @@ -36,8 +36,7 @@
<filter string="Won" name="won"
domain="['&amp;', ('stage_id.probability', '=', 100), ('stage_id.on_change', '=', 1)]"/>
<separator/>
<filter string="This Month" name="this_month" domain="[('date', '&gt;=', context_today().strftime('%%Y-%%m-01'))]"/>
<filter string="Last Month" name="last_month" domain="['&amp;', ('date', '&gt;=', (context_today() - relativedelta(months=1)).strftime('%%Y-%%m-01')), ('date', '&lt;', context_today().strftime('%%Y-%%m-01'))]"/>
<filter string="Date" name="this_month" date="date" default_period="this_month"/>
<field name="team_id" context="{'invisible_team': False}"/>
<field name="author_id" string="Created By"/>
<group expand="1" string="Group By">
Expand Down
4 changes: 2 additions & 2 deletions addons/crm/report/crm_opportunity_report_views.xml
Expand Up @@ -101,8 +101,8 @@
<field name="team_id" context="{'invisible_team': False}"/>
<field name="user_id" string="Salesperson"/>
<separator/>
<filter string="This Month" name="this_month" domain="[('date_closed', '&gt;=', context_today().strftime('%%Y-%%m-01'))]"/>
<filter string="Last Month" name="last_month" domain="['&amp;', ('date_closed', '&gt;=', (context_today() - relativedelta(months=1)).strftime('%%Y-%%m-01')), ('date_closed', '&lt;', context_today().strftime('%%Y-%%m-01'))]"/>
<filter string="Creation Date" name="creation_date_interval" date="create_date" default_period="this_month"/>
<filter string="Expected closing" name="this_month" date="date_closed" default_period="this_month"/>
<separator/>
<filter string="Current" name="current" domain="[('active', '=', True)]"/>
<filter string="Archived" name="archived" domain="[('active', '=', False)]"/>
Expand Down
8 changes: 2 additions & 6 deletions addons/crm/views/crm_lead_views.xml
Expand Up @@ -667,16 +667,12 @@
]"/>

<separator/>
<filter string="Creation Date" name="creation_date" date="create_date" default_period="this_week"/>
<filter string="Creation Date" name="creation_date" date="create_date" default_period="this_month"/>
<filter string="Expected closing" name="close_this_month" date="date_deadline" default_period="this_month"/>
<filter string="Overdue Opportunities" name="overdue_opp"
domain="[('date_deadline', '&lt;', context_today().strftime('%Y-%m-%d')), ('date_closed', '=', False)]"
help="Opportunities with a date of Expected Closing which is in the past"/>

<filter string="To Close This Month" name="close_this_month" domain="[
'&amp;',
('date_deadline', '&gt;=', (context_today() + relativedelta(day=1)).strftime('%Y-%m-%d')),
('date_deadline', '&lt;=', (context_today() + relativedelta(months=1, day=1, days=-1)).strftime('%Y-%m-%d')),
]"/>
<separator/>
<filter string="Lost" name="lost" domain="['&amp;', ('active', '=', False), ('probability', '=', 0)]"/>
<filter string="Won" name="won" domain="['&amp;', ('active', '=', True), ('stage_id.probability', '=', 100)]"/>
Expand Down
2 changes: 1 addition & 1 deletion addons/point_of_sale/views/pos_order_report_view.xml
Expand Up @@ -33,7 +33,7 @@
<filter string="Invoiced" name="invoiced" domain="[('state','=',('invoiced'))]"/>
<filter string="Not Invoiced" name="not_invoiced" domain="[('state','=',('paid'))]"/>
<separator/>
<filter string="Year" name="year" domain="[('date','&lt;=', time.strftime('%%Y-12-31')),('date','&gt;=',time.strftime('%%Y-01-01'))]" help="POS orders created during the current year"/>
<filter string="Order Date" name="order_date" date="date"/>
<separator/>
<filter string="My Sales" name="my_sales" help="My Sales" domain="[('user_id','=',uid)]"/>
<field name="config_id"/>
Expand Down
7 changes: 7 additions & 0 deletions addons/sale/views/sale_views.xml
Expand Up @@ -468,6 +468,9 @@
<filter string="Quotations" name="draft" domain="[('state','=','draft')]"/>
<filter string="Quotations Sent" name="sent" domain="[('state','=','sent')]"/>
<filter string="Sales" name="sales" domain="[('state','in',('sale','done'))]"/>
<separator/>
<filter string="Creation Date" name="creation_date_interval" date="create_date"/>
<filter string="Expiration Date" name="expiration_date" date="validity_date"/>
</xpath>
</field>
</record>
Expand All @@ -482,6 +485,10 @@
<filter string="To Invoice" name="to_invoice" domain="[('invoice_status','=','to invoice')]" />
<filter string="Upselling" name="upselling" domain="[('invoice_status','=','upselling')]" />
</xpath>
<xpath expr="//filter[@name='activities_upcoming_all']" position="after">
<separator/>
<filter string="Confirmation Date" name="confirmation_date_filter" date="confirmation_date"/>
</xpath>
</field>
</record>

Expand Down

0 comments on commit fac3bfa

Please sign in to comment.