python - Two classes in same model -


please let me know; in openerp 7, created 2 classes & 2 tables generated classes.finally called classes such checkroll() , workoffer().now works & thing want 2 tables generated 1 class wrong or correct per openerp standards.? there other way implement that.?

from openerp.osv import fields, osv  class checkroll(osv.osv):     _name = "checkroll.plucker"     _description = "this table keeping personal data of plucker"     _columns = {         'reg_no': fields.char('registration number', size=256, required=true),         'worker_name': fields.char('worker name', size=256, required=true),         'spouse_name': fields.char('spouse name', size=256),         'gender' : fields.selection((('male', 'male'), ('female', 'female'), ('middle', 'test')), 'gender', required=true),         'epf_no':fields.char('epf number', size=256)     }  checkroll()    class workoffer(osv.osv):     _name = "checkroll.work.offer"     _description = "this table keeping work offer data"     _columns = {         'date': fields.date("date"),         'division': fields.char('division', size=256, required=true),         'work' : fields.selection((('plucking', 'plucking'), ('tapping', 'tapping'), ('sundry_worker', 'sundry worker')), 'work', required=true),         'epf_no':fields.char('epf number', size=256)     }  workoffer() 

in openerp recommended define new model database table. here each model has 1 table in database. table name can define model attribute _table, if it's not defined take _name default removing .(dot) _(underscore).


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -