odoo/odoo — pull request #2898 by bmart (2014-10-03 17:28:59+00:00)
Title: [FIX] CRM - Lead Tags not Filtered by Sales Team appropriately

Current domain specification for categ_id in crm_lead did not filter tags by Sales team properly.
In addition, domain attribute in view specification appears to override this setting regardless.

Impacted versions:

7.0 and above
Steps to reproduce:

1) Enable Sales Team settings in Odoo.
2) Create tags associated with 1 Sales Team only.
3) Create a lead belonging to a different lead.
4) Select a tag - you will see all the tags and be able to search and choose whatever tag you want.

Current behavior:

IF tag is crm.lead OR section_id = False OR section_id = this_section_id

Means that all lead tags get picked up because the first condition always passes.

Expected behavior:

if tag is crm.lead AND (section_id = False OR section_id = this_section_id)