You are on page 1of 3

Aide

Dismiss 

Odoo is the world's easiest all-in-one management software.


It includes hundreds of business apps:
CRM e-Commerce Comptabilité Inventaire PoS Project management MRP
Take the tour

0 What is diff between


domain, domain
 

filter and attr ?


Dharmraj
14 juin 2013
votre adresse email... S'inscrire
 filter attrs domain
Can any one explain me the use of domain ,
domain filter and attrs in xml files ? Please also
explain that which should be used in which
scenario.
 Commenter

1 Réponse
 8 
Francesco Meilleure
OpenCode réponse
14 juin 2013
Domain = It's a filter you can apply on a
relation field. For example, if you hae a relation
to res.partner, with domain you can obtain
only customer in the search.
Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
Example: Search only customer in a many2one
field with res.partner relaton
<field name="partner_id"
string="Partner" domain="
[('customer','=',True)]"/>

Filter Domain = It's a composite filter you can


use in the search field. For example, when you
searcha product in the warehouse section, you
can search it by name or by code because the
module use domain_filter to create a
composite filter
Example: Search product for name or code in
te some search field
<field name="name" string="Product"
filter_domain="['|',
('name','ilike',self),
('default_code','ilike',self)]"/>

Attrs = They are a series of values use to


indicates some parameters for the field in
relation with other parameter. For example you
can change the reaonly, invisible or required
state of a field in relation to another field in
thesome form.
Example: Field name readonly if state is not
draft and required if amount is 0
<field name="name" attrs={'readonly':
[('state', '!=', 'draft'), 'required':
[('amount', '=', 0)]}/>

 Commentaires
2 Commentaires
Dharmraj - 14 juin 2013 

Explained very well :) Thank you Francesco


:)

Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com
Francesco OpenCode - 14 juin 2013 

Nice help you...;)

Convert web pages and HTML files to PDF in your applications with the Pdfcrowd HTML to PDF API Printed with Pdfcrowd.com

You might also like