Skip to Content
मेन्यू
This question has been flagged
1 Reply
6293 Views

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)

Avatar
Discard
Best Answer

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.

Avatar
Discard
Related Posts Replies Views Activity
1
नव॰ 24
27725
0
जून 25
357
1
मई 23
2041
1
जन॰ 24
15212
3
अग॰ 22
4025