I am trying to extract data from a .mdb database and get it in the columns of the Odoo 8 class.
This is my .py file
class attendance_biometric(osv.Model): _name="attendance.biometric" _rec_name='name' _columns={ 'fdate':fields.datetime('From Date'), 'tdate':fields.datetime('To Date'), 'code':fields.integer('Code'), 'name':fields.many2one('res.users','Employee Name', readonly=True), 'ref': fields.one2many('bio.data', 'bio_ref', 'Data'), } _defaults = { 'name': lambda obj, cr, uid, context: uid, } def confirm_submit(self, cr, uid, ids, context=None): result=[] DBfile = '/home/administrator/test.mdb' conn = pyodbc.connect('DRIVER=MDBtools;DBQ='+DBfile) cr = conn.cursor() sql = ''' select InTime, OutTime, OutDeviceId, Duration from AttendanceLogs ''' cr.execute(sql) rows = cr.fetchall() for row in enumerate(rows): result.append(row) raise osv.except_osv(_('Info'),_('Data : %s\n' % (result)))
Now, after some repetitive work, when I click the "Submit" button, the data is displayed, as in the following images

Can anyone make a valuable contribution to this? for example, how to get these values ββin the columns of the Odoo class (I had in mind the assignment to the fields of the class), as well as how to get the columns from two tables.
python ms-access odoo-9 odoo-8 openerp-8
Shravya shetty
source share