开发者

Openerp module update fails

开发者 https://www.devze.com 2023-04-05 16:18 出处:网络
I am in the process of trying to upgrade my module written for Openerp. Although it works fine on the local machine and the local openerp server. It gives me the below error when I try to update th开发

I am in the process of trying to upgrade my module written for Openerp. Although it works fine on the local machine and the local openerp server. It gives me the below error when I try to update th开发者_JAVA技巧e files via SVN to the staged server. The error states that they are trying to insert a record to the DB where is its actually an update not a insertion. I am worried to remove that record from the Postgres db directly though, i think it might do the trick.

I also removed all the existing files before I did the SVN update on the staged server. May be this might have been the pit fall but i am not quite sure. Let me know what you guys think is the best solution for this problem. Below is the error messages show in Openerp Server when its restarted after the SVN update. The Server Stops from here and never ends.

But soon as I revert the files or remove them and update the Server works like a Charm.

module abc: loading objects
[2011-09-14 08:12:49,425][oe_test] INFO:init:module abc:registering objects
[2011-09-14 08:12:49,432][oe_test] INFO:init:module abc: creating or updating database tables
[2011-09-14 08:12:49,434][oe_test] DEBUG:sql:bad query: INSERT INTO ir_model_data (name,date_init,date_update,module,model,res_id) VALUES (E'model_abc', now(), now(), E'abc', E'ir.model', 301)
[2011-09-14 08:12:49,434][oe_test] DEBUG:sql:('model_abc', u'abc', 'ir.model', 301)
[2011-09-14 08:12:49,434][oe_test] DEBUG:sql:duplicate key value violates unique constraint "ir_model_data_module_name_uniq"

Regards,

Gayan


[2011-09-14 08:12:49,434][oe_test] DEBUG:sql:duplicate key value violates unique constraint "ir_model_data_module_name_uniq"

In ir.model.data, there is an "_sql_constraint", defined for unique record name. so error comes from that code and says that You can't have duplicate record name.

as per my knowledge, this kind of error could occur, because of duplicate record id in your *_data.xml file.

Note : Check either noupdate="True" in your *_data.xml file or not.


After running around with the above problem I was able to figure out the actual cause and over come the issue. The underling problem was that I have another module which accidentally carries the same name. So due to this the above conflicting exception occurs. Finally I changed the module name, and the model names and the problem was sorted.

Thanks for all the inputs.

Regards,

Gayan


did you try to launch the server with -u your_module_name -d your_db_name?

0

精彩评论

暂无评论...
验证码 换一张
取 消