How to add a new customer filter string based on new company field

Paulo Matos‏

Dear all,

I have added a new boolean field on the Customers (res.partner) form, which user must choose from True or False. This field is used for customers where the field "Is a Company?" is selected.

Now, I need to add a filter on the customers tree view, that lists all Contacts from Customers (Contacts added and liked to that Company) where this new_field is True.

Standard Odoo already have several options to filter the customer tree view (by Customers, Suppliers / People, Company, etc.).

Now, I need to add a new filter that allows me to filter all contacts (people) from companies (Company), for which the new_field is TRUE.

This is the basic odoo search view (for tree view)

<?xml version="1.0"?>

<search string="Search Partner">

<field name="name" filter_domain="['|','|',('name','ilike',self),('parent_id','ilike',self),('ref','=',self)]"/>

<filter help="My Partners" icon="terp-personal+" domain="[('user_id','=',uid)]"/>


<filter string="Persons" name="type_person" domain="[('is_company','=',0)]"/>

<filter string="Companies" name="type_company" domain="[('is_company','=',1)]"/>


<filter string="Customers" name="customer" domain="[('customer','=',1)]" help="Customer Partners"/>

<filter string="Suppliers" name="supplier" domain="[('supplier','=',1)]" help="Supplier Partners"/>


<field name="category_id" string="Tag" filter_domain="[('category_id','ilike', self)]"/>

<field name="user_id"/>

<field name="parent_id" domain="[('is_company','=',1)]" filter_domain="[('parent_id','child_of',[self])]"/>

<group expand="0" string="Group By...">

<filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by' : 'user_id'}"/>

<filter string="Company" context="{'group_by': 'parent_id'}"/>

<filter string="Country" context="{'group_by': 'country_id'}"/>



Any help on adding this new filter based on people from any company which new_field is TRUE? I am not developing a new module. I am using the "Activate programmer mode" to make the changes.

Thank you very much.