over 9 years ago
If you want to create a model in OpenERP use like below code -
- from openerp.osv import fields, osv
- class course(osv.osv):
- _name='course'
- _columns= {
- 'name':fields.char("Name",size=128,domain=[('name', '=',2)]),
- 'gender':fields.boolean('Male'),
- 'description':fields.char("description",size=200),
- 'persons_id':fields.many2one('res.users' ,'person'),
- 'session':fields.one2many('session' ,'course','Session'),
- "qualification" : fields.selection([('a1','Undergraduate X'),('a2','Graduate'),('a3','Post Graduate')],"Education Qualification"),
- "termination1" : fields.many2one('hr.role1',' Termination'),
- }
from openerp.osv import fields, osv class course(osv.osv): _name='course' _columns= { 'name':fields.char("Name",size=128,domain=[('name', '=',2)]), 'gender':fields.boolean('Male'), 'description':fields.char("description",size=200), 'persons_id':fields.many2one('res.users' ,'person'), 'session':fields.one2many('session' ,'course','Session'), "qualification" : fields.selection([('a1','Undergraduate X'),('a2','Graduate'),('a3','Post Graduate')],"Education Qualification"), "termination1" : fields.many2one('hr.role1',' Termination'), }
0 Comment(s)