I am developing new modules for real estate on my Synology DS412+, when i modify one of my new modules:
- if for example, i add a new field : "basement" in the .py file and in the .xml file
when i click to update the modified module, OpenERP check the coherence of the modified module and say that the new fields dont exist in the model:
except_orm: ('View error', u"Can't find field 'basement' in the following view parts composing the view of object model 'apartment':\n * apartment.formb\n * apartment.form\n\nEither you wrongly customized this view, or some modules bringing those views are not compatible with your current data model")
As if OpenERP did not complile the modified module and dont create the new field....
I have read on this forum that i have to restart the OpenERP Server so that the modified module is recompiled. But it is not enough, the same error occurs.
To resolve the problem i have created a new module who inherit from the object i want to modifiy and inserted the new field in the second module by heritage. It works but it is not very acceptable to do this...
Could you please say me what is wrong in my approach????
You need to restart OpenERP if you make changes in .py files, and you only need to update your module if you make changes in xml. You will need to do both if you add or remove fields in a model or create a new model.
You are still getting the same error because you have already tried to upgrade your module before restarting the server.
To solve that remove your .xml view from the __opernerp__.py file, restart the server, update the module list and the module, add the .xml view again to __openerp__.py and update the module again.
This might help.
Thank you for your answers, i understand i have to restart when i modify the .py
But i have restarted and i always have the same error!!!
Could you help more precisely? For example do i have to uninstall the modified module before réinstall?
Thank you Sajad KK it is clear now i have made many updates in the .xml without restarting and one update in the .py with resart of OpenERP and it is clear for me the good strategy is to write directly the exact needed .py
I genraly itarated the object structure and with OpenERP it is not a good approach. Thank you.
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
|Asked: 5/16/14, 5:36 AM|
|Seen: 4123 times|
|Last updated: 3/16/15, 8:10 AM|