This question has been flagged
3072 Views

Hello ,

I deleted few entries directly from pgadmin .

Now when i restart my server with -u all -d database command , it throws following error:

How i can resolve this critical issue?

Server Traceback (most recent call last): File "/home/shazz/erp/openerp-7.0-20140113-001013/openerp/addons/web/session.py", line 89, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/home/shazz/erp/openerp-7.0-20140113-001013/openerp/netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/home/shazz/erp/openerp-7.0-20140113-001013/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, params) File "/home/shazz/erp/openerp-7.0-20140113-001013/openerp/osv/osv.py", line 190, in execute_kw return self.execute(db, uid, obj, method, *args, *kw or {}) File "/home/shazz/erp/openerp-7.0-20140113-001013/openerp/osv/osv.py", line 132, in wrapper return f(self, dbname, args, *kwargs) File "/home/shazz/erp/openerp-7.0-20140113-001013/openerp/osv/osv.py", line 199, in execute res = self.execute_cr(cr, uid, obj, method, args, *kw) File "/home/shazz/erp/openerp-7.0-20140113-001013/openerp/osv/osv.py", line 187, in execute_cr return getattr(object, method)(cr, uid, args, *kw) File "/home/shazz/erp/openerp-7.0-20140113-001013/openerp/addons/base/module/module.py", line 513, in button_immediate_upgrade return self._button_immediate_function(cr, uid, ids, self.button_upgrade, context=context) File "/home/shazz/erp/openerp-7.0-20140113-001013/openerp/addons/base/module/module.py", line 475, in _button_immediate_function _, pool = pooler.restart_pool(cr.dbname, update_module=True) File "/home/shazz/erp/openerp-7.0-20140113-001013/openerp/pooler.py", line 39, in restart_pool registry = RegistryManager.new(db_name, force_demo, status, update_module) File "/home/shazz/erp/openerp-7.0-20140113-001013/openerp/modules/registry.py", line 219, in new openerp.modules.load_modules(registry.db, force_demo, status, update_module) File "/home/shazz/erp/openerp-7.0-20140113-001013/openerp/modules/loading.py", line 387, in load_modules pool.get('ir.model.data')._process_end(cr, SUPERUSER_ID, processed_modules) File "/home/shazz/erp/openerp-7.0-20140113-001013/openerp/addons/base/ir/ir_model.py", line 1125, in _process_end self.pool.get(model).unlink(cr, uid, [res_id]) File "/home/shazz/erp/openerp-7.0-20140113-001013/openerp/addons/product/product.py", line 592, in unlink tmpl_id = product.product_tmpl_id.id File "/home/shazz/erp/openerp-7.0-20140113-001013/openerp/osv/orm.py", line 499, in __getattr__ raise AttributeError(e) AttributeError: 'Field product_tmpl_id not found in browse_record(product.product, 2349)'

Avatar
Discard

Hi Shashank,

The entries you deleted has been used as foreign key reference in other modules and hence throwing this error as the entries are no longer available. If you know the number of entries you have deleted, then just add that many records in the DB again with some dummy data but if there are other ids (foreign key ids) present just try to give from existing ones. Then restart server and once you are able to login to the OpenERP, then you can delete those from front end.

You shouldn't delete directly from DB, if you wanna do such then go with cascade delete.

Cheers

ASP :)