Guest User

Untitled

a guest
Dec 23rd, 2014
146
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Invoice:
  2. __metaclass__ = PoolMeta
  3. __name__ = 'account.invoice'
  4.  
  5. groupe = fields.Many2One(
  6. 'forest_group.group',
  7. string=u'Groupement',
  8. help=u'Groupement',
  9. states=_STATES,
  10. depends=_DEPENDS
  11. )
  12. forest = fields.Many2One(
  13. 'forest.forest',
  14. string=u'Forest',
  15. help=u'Forest',
  16. states=_STATES,
  17. depends=_DEPENDS,
  18. domain=[('owner', '=', Eval('partyid'))],
  19. on_change_with=['groupe'],
  20. )
  21.  
  22. def on_change_with_forest(self):
  23. if self.groupe is None:
  24. return None
  25.  
  26. partyid = fields.Integer(
  27. string=u'idp',
  28. on_change_with=['groupe'],
  29. readonly=True,
  30. )
  31.  
  32. def on_change_with_partyid(self):
  33. if self.groupe is not None:
  34. return self.groupe.party.id
RAW Paste Data