Guest User

Untitled

a guest
Feb 18th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. #mydev.py
  2. from trytond.model import ModelView, ModelSQL, fields
  3. class Theparent(ModelSQL, ModelView):
  4.     'TheParent'
  5.     _name = 'mydev.theparent'
  6.     _description = __doc__
  7.     name = fields.Char('Parent Name')
  8.     desc = fields.Char('Parent Desc')
  9.  
  10. Theparent()
  11.  
  12. class Thechild(ModelSQL, ModelView):
  13.     'TheChild'
  14.     _name = 'mydev.thechild'
  15.     _description = __doc__
  16.     theparent = fields.Many2One('mydev.theparent', 'Theparent',
  17.             required=True,
  18.             ondelete='CASCADE')
  19.     name = fields.Char('Child Name')
  20.     desc = fields.Char('Child Desc')
  21.  
  22. Thechild()
Add Comment
Please, Sign In to add comment