widget=“selection” with domain fields issue

主宰稳场 提交于 2019-12-12 03:29:31

问题


here is my view xml part

<field name="bpl_estate_id" placeholder="Estate" widget="selection" />

here is my model python part

'bpl_company_id':fields.many2one('res.company', 'Company', help='Company'),
'bpl_estate_id':fields.many2one('bpl.estate.n.registration', 'Estate', 
domain="[('company_id','=',bpl_company_id)]"),

my issue is when i used estate field,with widget option, then no domain filtered ? (show all records)

please advice me to implement this


回答1:


Dynamic domains are not supported on selection widgets, simple as that

https://lists.launchpad.net/openerp-india/msg03333.html




回答2:


You have to use an onchange to set the domain dynamically. Look at this.



来源:https://stackoverflow.com/questions/16134784/widget-selection-with-domain-fields-issue

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!