Odoo Help

0

how to set field attr by on_change function?

By
voathnak lim
on 9/25/13, 11:18 PM 1,502 views

Hello does anyone have any idea or doc about return the attr like : invisible or required from on_change function?

1

Andreas Brueckl

--Andreas Brueckl--
5131
| 7 8 7
Vienna, Austria
--Andreas Brueckl--
OpenERP Consulting and Development
Andreas Brueckl
On 9/26/13, 5:02 AM

You can do it the following (indirect) way:

  • Use a hidden boolean field flag
  • For the field you want to set required or invisible use attrs="{'invisible': [('flag','=',True)]}"
  • In the on_change function you can now return the value for flag

Thank you Andre, but the field flag gonna save in database right?, and could we have another solution like return context or domain...?

voathnak lim
on 9/27/13, 1:18 AM

Nice suggestion :)

DM
on 5/28/15, 8:23 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 9/25/13, 11:18 PM
Seen: 1502 times
Last updated: 3/16/15, 8:10 AM