Here is my class and methods.
I just wrote for get records and need to print them.but when run openerp in debug mode.its not worked & not go for that method also.& also need to clarify the fetching methods OpenERP 7
class namelistupdate(osv.osv):
def _mytest_query(self, cr, uid, ids, name, args, context=None):
print ('here is demo sql query function result ')
cr.execute("""SELECT module,(id*5000)as result FROM ir_model_data WHERE id=1""")
res = cr.dictfetchall()
print ('here is demo sql query function result ')
print (res)
def _invoiced_rate(self, cr, uid, ids, name, args, context):
self._mytest_query(cr, uid, ids, name, args, context)
amount_untaxed = 1
record_id = ids[0]
res = {record_id: 0.0}
if amount_untaxed == 0:
res[record_id] = 100.0
else:
res[record_id] = 50.0
return res
_name = "checkroll.namelist.update"
_description = "This table is for keeping Name list updates"
_columns = {
'date': fields.date("Date"),
'val': fields.function(_invoiced_rate, method=True, type='float', string='Test', store=True),
}
namelistupdate()
now not a error .but out put as
here is demo sql query function result here is demo sql query function result []its need to be as
| base | 5000 |