Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
10003 Visualizzazioni

Hello all, how the domain fields is working, explain with sample code

Avatar
Abbandona
Risposta migliore

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.

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
set 18
9904
1
giu 15
6170
3
mag 24
6622
2
dic 21
6600
2
mag 24
4364