[FIX] fix wrong filter in opportunity view (crm)
authorGéry Debongnie <ged@odoo.com>
Thu, 20 Nov 2014 10:25:49 +0000 (11:25 +0100)
committerGéry Debongnie <ged@odoo.com>
Thu, 20 Nov 2014 12:23:04 +0000 (13:23 +0100)
There was two problems:
* it was filtering on the probability of the opportunity, not on the
probability of the stage
* the filters were not prefixed with '&', which means that they gave
weird results when combined in the searchview (in a filter group, filters
are combined with '|', but it breaks when the filters are defined by
an implicit '&')

addons/crm/crm_lead_view.xml

index 07c9f05..e294d76 100644 (file)
                     <field name="probability"/>
                     <separator/>
                     <filter string="New" name="new"
-                            domain="[('probability', '=', 0), ('stage_id.sequence', '&lt;=', 1)]"/>
+                            domain="['&amp;', ('stage_id.probability', '=', 0), ('stage_id.sequence', '&lt;=', 1)]"/>
                     <filter string="Won" name="won"
-                            domain="[('probability', '=', 100), ('stage_id.fold', '=', True)]"/>
+                            domain="['&amp;', ('stage_id.probability', '=', 100), ('stage_id.fold', '=', True)]"/>
                     <filter string="Lost" name="lost"
-                            domain="[('probability', '=', 0), ('stage_id.fold', '=', True)]"/>
+                            domain="['&amp;', ('stage_id.probability', '=', 0), ('stage_id.fold', '=', True)]"/>
                     <separator/>
                     <filter string="My Opportunities" name="assigned_to_me"
                             domain="[('user_id', '=', uid)]"