KeyError: 'id' shows when more than 2 entries are inserted
hi,
i'm trying to develop a new module in openerp 7.0. i have created a py file which creates the table "app_obj". when i save the first data into the table, it works fine. upon inserting the 2nd data and saving, it shows the following error:
OpenERP Server Error
Client Traceback (most recent call last):
File "D:\OpenERP 7.0-20130828-
File "D:\OpenERP 7.0-20130828-
File "D:\OpenERP 7.0-20130828-
File "D:\OpenERP 7.0-20130828-
File "D:\OpenERP 7.0-20130828-
File "D:\OpenERP 7.0-20130828-
Server Traceback (most recent call last):
File "D:\OpenERP 7.0-20130828-
File "D:\OpenERP 7.0-20130828-
File "D:\OpenERP 7.0-20130828-
File "D:\OpenERP 7.0-20130828-
File "D:\OpenERP 7.0-20130828-
File "D:\OpenERP 7.0-20130828-
File "D:\OpenERP 7.0-20130828-
File "D:\OpenERP 7.0-20130828-
File "D:\OpenERP 7.0-20130828-
KeyError: 2
from the postgresql, i can see that the second entry has an id 2. creating a new database and reinstalling the module does not fix it (which may mean that the error is due to any missing record). and below is the py file:
from osv import osv, fields
# import pooler
import datetime
class app_obj(osv.osv):
count=1
start_
end_
def serial(self, cr, uid, ids, arg1, arg2, context=None):
return {ids[0]:count}
def doc_name_
if doc_name2:
for r in query_result:
if doc_name2 == r['id']:
return {'value': {'from':time_start, 'to':time_end}}
_name= "app_obj"
_columns = {
}
_defaults={
}
app_obj()
spent a lot of time trying to find solution online, but no luck.
am developing is windows 7 platform, chrome version 29.0.1547.76 m, in case its relevant.
any help will be greatly appreciated!
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Serpent Consulting Services
- Solved:
- Last query:
- Last reply: