diff options
| author | Géry Debongnie <ged@odoo.com> | 2018-06-15 10:36:31 +0200 |
|---|---|---|
| committer | Adrien Dieudonne <adr@odoo.com> | 2018-07-06 14:09:09 +0200 |
| commit | f9874b2b047332bba5a032a506f63e8d453794bd (patch) | |
| tree | d8a2733fb435a7e5e1086d9b78b80e4cf24e3945 /addons/crm | |
| parent | 097464de6f85020ad1e56bbc253837a7d60e47e4 (diff) | |
[IMP] *: adaptation of search views
It is now possible to easily filter data using periods of time
(e.g. Creation Date: This Week). This adds greater flexibility to the search
view and has made some old filters become useless. In this commit, we alter
the search views in order to profit of the new framework possibilities.
Diffstat (limited to 'addons/crm')
| -rw-r--r-- | addons/crm/report/crm_activity_report_views.xml | 3 | ||||
| -rw-r--r-- | addons/crm/report/crm_opportunity_report_views.xml | 8 | ||||
| -rw-r--r-- | addons/crm/views/crm_lead_views.xml | 10 |
3 files changed, 10 insertions, 11 deletions
diff --git a/addons/crm/report/crm_activity_report_views.xml b/addons/crm/report/crm_activity_report_views.xml index 8ddf6fcc63a..2e5c6642159 100644 --- a/addons/crm/report/crm_activity_report_views.xml +++ b/addons/crm/report/crm_activity_report_views.xml @@ -36,8 +36,7 @@ <filter string="Won" name="won" domain="['&', ('stage_id.probability', '=', 100), ('stage_id.on_change', '=', 1)]"/> <separator/> - <filter string="This Month" name="this_month" domain="[('date', '>=', context_today().strftime('%%Y-%%m-01'))]"/> - <filter string="Last Month" name="last_month" domain="['&', ('date', '>=', (context_today() - relativedelta(months=1)).strftime('%%Y-%%m-01')), ('date', '<', context_today().strftime('%%Y-%%m-01'))]"/> + <filter string="Date" name="filter_date" date="date"/> <field name="team_id" context="{'invisible_team': False}"/> <field name="author_id" string="Created By"/> <group expand="1" string="Group By"> diff --git a/addons/crm/report/crm_opportunity_report_views.xml b/addons/crm/report/crm_opportunity_report_views.xml index 8ae35895a38..86058e9c5d5 100644 --- a/addons/crm/report/crm_opportunity_report_views.xml +++ b/addons/crm/report/crm_opportunity_report_views.xml @@ -101,8 +101,9 @@ <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', '>=', context_today().strftime('%%Y-%%m-01'))]"/> - <filter string="Last Month" name="last_month" domain="['&', ('date_closed', '>=', (context_today() - relativedelta(months=1)).strftime('%%Y-%%m-01')), ('date_closed', '<', context_today().strftime('%%Y-%%m-01'))]"/> + <filter string="Creation Date" name="filter_create_date" date="create_date"/> + <filter string="Expected Closing" name="filter_date_deadline" date="date_deadline"/> + <filter string="Date Closed" name="date_closed_filter" date="date_closed"/> <separator/> <filter string="Current" name="current" domain="[('active', '=', True)]"/> <filter string="Archived" name="archived" domain="[('active', '=', False)]"/> @@ -127,8 +128,9 @@ <filter string="Stage" name="stage" context="{'group_by':'stage_id'}"/> <separator orientation="vertical" /> <filter string="Creation Date" context="{'group_by':'create_date:month'}" name="month"/> - <filter string="Expected Closing" context="{'group_by':'date_deadline:month'}" name="date_deadline"/> <filter string="Conversion Date" context="{'group_by':'date_conversion:month'}" name="conversion_date" help="Conversion Date from Lead to Opportunity"/> + <filter string="Expected Closing" context="{'group_by':'date_deadline:month'}" name="date_deadline"/> + <filter string="Closed Date" context="{'group_by':'date_closed'}" name="date_closed_groupby"/> <filter string="Lost Reason" name="lostreason" context="{'group_by':'lost_reason'}"/> </group> </search> diff --git a/addons/crm/views/crm_lead_views.xml b/addons/crm/views/crm_lead_views.xml index eed0b44ce05..e720acda11e 100644 --- a/addons/crm/views/crm_lead_views.xml +++ b/addons/crm/views/crm_lead_views.xml @@ -667,16 +667,13 @@ ]"/> <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"/> + <filter string="Expected Closing" name="close_this_month" date="date_deadline"/> + <filter string="Closed Date" name="close_date" date="date_closed"/> <filter string="Overdue Opportunities" name="overdue_opp" domain="[('date_deadline', '<', 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="[ - '&', - ('date_deadline', '>=', (context_today() + relativedelta(day=1)).strftime('%Y-%m-%d')), - ('date_deadline', '<=', (context_today() + relativedelta(months=1, day=1, days=-1)).strftime('%Y-%m-%d')), - ]"/> <separator/> <filter string="Lost" name="lost" domain="['&', ('active', '=', False), ('probability', '=', 0)]"/> <filter string="Won" name="won" domain="['&', ('active', '=', True), ('stage_id.probability', '=', 100)]"/> @@ -692,6 +689,7 @@ <separator orientation="vertical" /> <filter string="Creation Date" context="{'group_by':'create_date:month'}" name="month"/> <filter string="Expected Closing Date" name="date_deadline" context="{'group_by':'date_deadline'}"/> + <filter string="Closed Date" name="close_date_groupby" context="{'group_by':'date_closed'}"/> <filter string="Lost Reason" name="lostreason" context="{'group_by':'lost_reason'}"/> </group> </search> |
