Community mailing list archives
Re: reinstalling website module generates integrety errorby
cheers robert! will give it a try
2015-09-29 0:52 GMT-05:00 robert rottermann <firstname.lastname@example.org>:
Hi Arjan,<blockquote cite="mid:CAK0DvK69pG+QR6tojYTVJTRRKr1K6HBrvR8VtZvTPzbqD7Vh_Q@mail.gmail.com" type="cite">
I do not know odoo well at all, so I have no idea, whether the following helps or hinders.
Try it out on a backup of your database.
For experiments like this I have a local instance, where I restore a dump of the life database.
On 28.09.2015 15:47, Arjan Duijs wrote:
This error is not only occuring during the reinstall of the website module but with ALL install/uprade/remove action of any moduleyou could add the missing record with a sql statement like the following.ValueError: "insert or update on table "website" violates foreign key constraint "website_company_id_fkey" DETAIL: Key (company_id)=(3) is not present in table "res_company". " while evaluating u"self.button_immediate_install(cr, uid, context.get('active_ids', ), context=context)"
Use either psql, or better pgadmin3 to execute it.
insert into res_company
3, <----- this is the missing id
from res_company where id = 1;
this will create a record where all the required fields are copied of the existing company with id 1.
This works for me to create a new record. whether a "missing" one can be created in the same maner, I have no idea..
<blockquote cite="mid:CAK0DvK69pG+QR6tojYTVJTRRKr1K6HBrvR8VtZvTPzbqD7Vh_Q@mail.gmail.com" type="cite">Is there a solution for these kind of integrety errors? or this one specific?starting with a fresh new install not really is an here..
hope you can help.
2015-09-26 17:09 GMT-05:00 Arjan Duijs <email@example.com>:
I am trying to reinstall the website module (after uninstalling it while thinking i was uninstalling the shop module..sigh) but it generates the following error:
The operation cannot be completed, probably due to the following:
- deletion: you may be trying to delete a record while other records still reference it
- creation/update: a mandatory field is not correctly set
[object with reference: Companies - res.company]
any idea how to solve this?