Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #mydev.py
- from trytond.model import ModelView, ModelSQL, fields
- class Theparent(ModelSQL, ModelView):
- 'TheParent'
- _name = 'mydev.theparent'
- _description = __doc__
- name = fields.Char('Parent Name')
- desc = fields.Char('Parent Desc')
- Theparent()
- class Thechild(ModelSQL, ModelView):
- 'TheChild'
- _name = 'mydev.thechild'
- _description = __doc__
- theparent = fields.Many2One('mydev.theparent', 'Theparent',
- required=True,
- ondelete='CASCADE')
- name = fields.Char('Child Name')
- desc = fields.Char('Child Desc')
- Thechild()
Add Comment
Please, Sign In to add comment