Hello all, how the domain fields is working, explain with sample code
This question has been flagged
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.
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Přihlásit se| Related Posts | Odpovědi | Zobrazení | Aktivita | |
|---|---|---|---|---|
|
|
1
zář 18
|
10896 | ||
|
optional parameter fields/property
Vyřešeno
|
|
1
čvn 15
|
7052 | |
|
|
3
kvě 24
|
7968 | ||
|
One2many field domain not working
Vyřešeno
|
|
2
pro 21
|
7584 | |
|
|
2
kvě 24
|
5506 |