跳至内容
菜单
此问题已终结
1 回复
6201 查看

I would hide fields dynamically from python, required them, or read-only; from python I've seen that can return a 'domain' for a field, is it possible this same way also return 'attrs'?

example: 

                res.setdefault('domain', {})
                res['domain']['sale_tax'] = repr(sale_tax_domain)
                res['domain']['purchase_tax'] = repr(purchase_tax_domain)

形象
丢弃
最佳答案

attrs can be set using domain.  You can set the domain to use turn readonly, required, and invisible of the attrs based on the value of a field (or combination of those).  Or, if you really need, create a function field of boolean type to calculate the readonly, required, and invisible, then use that in the attrs domain.

形象
丢弃
相关帖文 回复 查看 活动
1
11月 24
27644
0
6月 25
303
1
5月 23
2011
1
1月 24
15136
3
8月 22
3889