Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I have model to store training results for athletes and tree view to insert results from
what I need is to create a button where it's function is : onClick , it filters the visibility of the shown columns in the tree view according to the exercise state ; so that if the exercise state's value is "by_distance" then it shows only the column that holds the values of by distance
Also the visibility have to be automatically changed so that if the exercise state becomes "by_weight" it changes to it and so on .
_name = 'general_fitness_details'
generalFitnessDetails = Many2one("general_fitness")
player = Many2one('player')
exercise = Many2one("exercise")
exercise_state = Selection([('by_reps', 'By Reps'),
('by_time', 'By Time'),
('by_distance', 'By Distance'),
('by_weight', 'By Weight')])
reps = Integer(string='Reps')
time_sec = Integer(string='Seconds')
weight = Integer(string='Weight/KG')
distance = Integer(string='Distance/Meters')
<field name="reps" invisible="[('exercise_state', '=', 'by_reps')]"/>
<field name="time_sec" invisible="[('exercise_state', '=', 'by_time')]"/>
<field name="weight" invisible="[('exercise_state', '=', 'by_weight')]"/>
<field name="distance" invisible="[('exercise_state', '=', 'by_distance')]"/>
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!
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
|Asked: 11/16/16, 12:12 PM|
|Seen: 275 times|
|Last updated: 11/16/16, 2:45 PM|