Odoo Help

Welcome!

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

0

How Can I alter the next in Line Database ID(pkey) for Account.account object

By
Chike Nwogu
on 5/6/13, 6:35 AM 1,574 views

Hi Folks, Tops to you this day. I imported accounts (account_account) directly from pgadmin. Afterwards I tried to create a new account from OpenERP, when I try to save,I get the following error message

"duplicate key value violates unique constraint "account_account_pkey" DETAIL: Key (id)=(114) already exists."

Apparently before I imported the accounts from pgadmin, the next in line pkey was 114, I manually assigned this as a database id for one of the imported accounts but somehow the system does not consider the manually assigned database id (assigned during my pgadmin import). I imagine it stores OpenERP assigned database ID some where so I need to go and update that to read the actual last database id based on my assigned values.

Does anyone know where that it is stored or how I can achieve that?

many thanks in advance for your help.

Cheers

I tried it out and it worked. Many Thanks

Chike Nwogu
on 5/6/13, 10:38 AM

Flag as answered, thx

ECP D
on 5/6/13, 11:19 AM

@Chike: in the left margin of ECP D's answer there is a check mark. Click on it, to mark your question as answered fully. That way others (like me, for example) will not waste time reading a question which has already been answered. Also, click the up arrow, as I just did, to give ECP D further "karma points" for his excellent, rapid and accurate answer.

Martin
on 5/6/13, 12:03 PM

@Martin Just did.Thanks

Chike Nwogu
on 5/6/13, 3:33 PM
2
ECP D
On 5/6/13, 11:18 AM

Hi Go to pgadmin, YOURDATABASE/schemas/public/sequences/res_partner_id_seq and Alter/restart value (on your example its need to be what u got in the error message 114.. ) Set this value to the last ID after importing manually your partners.

Your Answer

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/6/13, 6:35 AM
Seen: 1574 times
Last updated: 3/16/15, 8:10 AM