Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
9947 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
wrz 18
9830
1
cze 15
6135
3
maj 24
6543
2
gru 21
6536
2
maj 24
4291