Guest User

Untitled

a guest
Jan 23rd, 2015
191
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class emplacement(ModelSQL, ModelView):
  2. u'Emplacement'
  3. __name__ = 'cg.emplacement'
  4. _rec_name = 'code'
  5.  
  6. code = fields.Integer(
  7. string = u'Code emplacement',
  8. help=u'Code de l\'emplacement',
  9. required = True,
  10. states=STATES,
  11. depends=DEPENDS,
  12. )
  13.  
  14. evolution = fields.One2Many(
  15. 'cg.evol_emplacement',
  16. 'emplacement',
  17. string=u'Évolutions',
  18. help=u'Évolutions de l\'emplacement',
  19. states=STATES,
  20. depends=DEPENDS,
  21. )
  22.  
  23. class evol_emplacement(ModelSQL, ModelView):
  24. u'Évolution d\'un emplacement'
  25. __name__ = 'cg.evol_emplacement'
  26.  
  27. emplacement = fields.Many2One(
  28. 'cg.emplacement',
  29. string=u'Emplacement',
  30. help=u'Emplacement',
  31. )
  32.  
  33. @staticmethod
  34. def default_emplacement():
  35. return 0
  36.  
  37. test = fields.Integer(
  38. string=u'How many evolution exist before i create this new evolution ?',
  39. on_change_with=['emplacement']
  40. )
  41.  
  42. def on_change_with_test(self, name=None):
  43. return self.emplacement
RAW Paste Data