Advertisement
b0r7

helloworld module tryton2.8

Apr 24th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. ## Im trying to get a grip on development for tryton 2.8
  2. ## here is a basic helloworld module displaying a menu item in the tryton client
  3. ## you may have to restart the tryton server after changing some code
  4.  
  5.  
  6. helloworld/__init__.py ##
  7. ##########################
  8. from trytond.pool import Pool
  9. from .helloworld import *
  10.  
  11.  
  12. def register():
  13. Pool.register(
  14. Hello,
  15. module='helloworld', type_='model')
  16.  
  17. helloworld/tryton.cfg ##
  18. ########################
  19. [tryton]
  20. version=2.8.0
  21. depends:
  22. ir
  23. res
  24. xml:
  25. helloworld.xml
  26.  
  27.  
  28. helloworld/helloworld.py ##
  29. ###########################
  30. from trytond.model import ModelView, ModelSQL, fields
  31.  
  32. __all__ = ['Hello']
  33.  
  34.  
  35. class Hello(ModelSQL, ModelView):
  36. "Hello World"
  37. __name__ = "hello.hello"
  38.  
  39.  
  40. helloworld/helloworld.xml ##
  41. ############################
  42. <?xml version="1.0"?>
  43. <!-- This file is part of Tryton. The COPYRIGHT file at the top level of
  44. this repository contains the full copyright notices and license terms. -->
  45. <tryton>
  46. <data>
  47. <menuitem name="Hello World" id="menu_hello_world" sequence="10"/>
  48. </data>
  49. </tryton>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement