widget=“selection” with domain fields issue

2019-09-12 10:10发布

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

2条回答
男人必须洒脱
2楼-- · 2019-09-12 10:33

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

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

查看更多
劳资没心,怎么记你
3楼-- · 2019-09-12 10:37

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

查看更多
登录 后发表回答