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:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
此问题已终结
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.
相关帖文 | 回复 | 查看 | 活动 | |
---|---|---|---|---|
|
1
9月 18
|
9636 | ||
|
1
6月 15
|
5933 | ||
|
3
5月 24
|
6111 | ||
|
2
12月 21
|
6231 | ||
|
2
5月 24
|
3970 |