Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I'm using the latest OpenERP 7 version download from the site. I have a module overriden hr.employee just adding some fields. I loaded the data from the old systeem via the import functionality into OpenERP. Now I want to update the custom module by launching OpenERP via the argument --update=<my module="">. I get the following error:
WARNING: No field_values found for ids  in browse_record(hr.employee, 43) ERROR: Field resource_id not found in browse_record(hr.employee, 43)
The stacktrace is as follows:
> Traceback (most recent call last): > File "/home/fsan/Projects/OpenERP > 7.0/openerp/netsvc.py", line 292, in dispatch_rpc > result = ExportService.getService(service_name).dispatch(method, > params) File > "/home/fsan/Projects/OpenERP > 7.0/openerp/service/web_services.py", line 622, in dispatch > security.check(db,uid,passwd) File
7.0/openerp/service/security.py", line 40, in check pool = pooler.get_pool(db) File "/home/fsan/Projects/OpenERP 7.0/openerp/pooler.py", line 49, in get_pool return get_db_and_pool(db_name, force_demo, status, update_module) File "/home/fsan/Projects/OpenERP 7.0/openerp/pooler.py", line 33, in get_db_and_pool registry = RegistryManager.get(db_name, force_demo, status, update_module)
File "/home/fsan/Projects/OpenERP 7.0/openerp/modules/registry.py", line 192, in get update_module) File "/home/fsan/Projects/OpenERP 7.0/openerp/modules/registry.py", line 218, in new openerp.modules.load_modules(registry.db, force_demo, status, update_module)
File "/home/fsan/Projects/OpenERP 7.0/openerp/modules/loading.py", line 379, in load_modules pool.get('ir.model.data')._process_end(cr, SUPERUSER_ID, processed_modules)
File "/home/fsan/Projects/OpenERP 7.0/openerp/addons/base/ir/ir_model.py", line 1121, in _process_end self.pool.get(model).unlink(cr, uid, [res_id]) File "/home/fsan/Projects/OpenERP 7.0/openerp/addons/hr/hr.py", line 230, in unlink resource_ids.append(employee.resource_id.id) File "/home/fsan/Projects/OpenERP 7.0/openerp/osv/orm.py", line 488, in __getattr__ raise AttributeError(e) AttributeError: 'Field resource_id not found in browse_record(hr.employee, 43)'
I noticed in the hr.employee code that the unlink method doesn't actually unlink the employee but only the resource attached to the employee although the resource_id field on the hr.employee class is set with "on_delete='cascade'". The super unlink is not called as well. Is this a bug or am I missing something.
hr.employee and resource.resource are two different objects/table, but are bounded together in hr.employee using inherits property.. so for every record in hr.employee there should exists a corresponding record in resource.resource, (resulting otherwise will throw such error)..
thus make sure, both tables are imported accordingly...
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 9/6/13, 8:14 AM|
|Seen: 4832 times|
|Last updated: 3/16/15, 8:10 AM|