Welcome!

Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

Sign up

You need to be registered to interact with the community.
This question has been flagged
1 Reply
16 Views

Hey Cyllo community! Is there a way to dynamically show/hide fields without using the `attrs` attribute, since i know attrs is no longer used? Looking for a cleaner, maybe more efficient alternative. Thanks!

Avatar
Discard

Here's how you can achieve the functionality using the updated method in Odoo 17. This avoids the deprecated 'attrs' dictionary and uses inline expressions for cleaner code. 


   product.category.view.form

    product.category

   

       

           

               

                   

                           readonly= “'state' == 'done’” 

                           required'= “'type' == 'special'"

                           string="Category Name"/>

                   

                   

                   

               

           

       

   


Avatar
Discard

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!