b0r7

tryton client - click on boolean

Feb 15th, 2014
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. # inside a model
  2. myfield = fields.Boolean('My Label', states={
  3. 'readonly': ~Eval('active', True),
  4. }, depends=['active'])
  5.  
  6. # on form_view one can click a checkbox to set true/false
  7.  
  8. # there is a menuitem which asigns an action that shows only record where myfield = false, using domain
  9. <record model="ir.action.act_window" id="act_myid">
  10. <field name="name">my Name</field>
  11. <field name="res_model">mymodel.model</field>
  12. <field name="domain">[('myfield','=','false')]</field>
  13. </record>
  14.  
  15. # on tree_view
  16. <!-- other code-->
  17. <field name="myfield"/>
  18. <!-- other code -->
  19.  
  20. # the treeview displays just fine ..when i click on a record, not the record opens, but the myfield checkbox is being set to 'true'
  21. # i would like to open a record instead..
  22.  
  23. <field name="myfield" readonly="1"/> does not work
Advertisement
Add Comment
Please, Sign In to add comment