Hello all, how the domain fields is working, explain with sample code
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilité
- Inventaire
- PoS
- Project
- MRP
Cette question a été signalée
Domain is working like select query of sql having where condition. We can give 'and' & 'or' conditions in that.
Example: <record model="ir.actions.act_window" id="crm_case_category_act_leads_all"> <field name="name">Leads</field> <field name="res_model">crm.lead</field> <field name="domain">['|', ('type','=','lead'), ('type','=',False)]</field> </record>
This will give the same output as following sql query: select * from crm_lead where type = 'lead' or type = 'false';
We can apply domain on some field like : <field string="Supplier" name="partner_id" domain="[('supplier', '=', True)]"/>
This will give suppliers from res_partner object.
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrirePublications associées | Réponses | Vues | Activité | |
---|---|---|---|---|
|
1
sept. 18
|
9620 | ||
|
1
juin 15
|
5925 | ||
|
3
mai 24
|
6105 | ||
|
2
déc. 21
|
6215 | ||
|
2
mai 24
|
3967 |