Community mailing list archives

community@mail.odoo.com

Re: reinstalling website module generates integrety error

by
Arjan Duijs
- 09/29/2015 09:57:47
cheers robert! will give it a try

2015-09-29 0:52 GMT-05:00 robert rottermann <robert@redcor.ch>:
Hi Arjan,
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:
<blockquote cite="mid:CAK0DvK69pG+QR6tojYTVJTRRKr1K6HBrvR8VtZvTPzbqD7Vh_Q@mail.gmail.com" type="cite">
This error is not only occuring during the reinstall of the website module but with ALL install/uprade/remove action of any module
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)"
you could add the missing record with a sql statement like the following.
Use either psql, or better pgadmin3 to execute it.
insert into res_company
(
    id,
    name,
    partner_id,
    currency_id,
    rml_header,
    rml_paper_format,
    rml_header2,
    rml_header3,
    manufacturing_lead,
    security_lead,
    po_lead
)  select
    3,  <----- this is the missing id
    'tempname',
    partner_id,
    currency_id,
    rml_header,
    rml_paper_format,
    rml_header2,
    rml_header3,
    manufacturing_lead,
    security_lead,
    po_lead
 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..

robert


<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.

regards

2015-09-26 17:09 GMT-05:00 Arjan Duijs <arjanduijs@gmail.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:

Integrity 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?

thanks

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe