Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
4 Replies
31779 Tampilan

Hi, 

Trying to import translation in Odoo 12, i get the following error : 

ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time
HINT: Ensure that no rows proposed for insertion within the same command have duplicate constrained
values.

i did some research and found out that postgres included On Conflict to 'Upsert' a record. 
That is to say : when you insert a new row into the table, PostgreSQL will update the row if it already exists, otherwise, PostgreSQL inserts the new row. 

See http://www.postgresqltutorial.com/postgresql-upsert/ for more details. 

In my case, what should i do so that i can import translation successfully ?

Thank you.

Avatar
Buang

Did you check that you aren't trying to translate the same thing twice in the same import file?

I experience the same issue if the option 'Overwrite existing terms' is turned on. It seems that the bug https://github.com/odoo/odoo/issues/27268 is not fully fixed

Penulis

Hi @Ray,

Yes, i'm not translating the same thing twice in the same import file.

@Odoo Tools,

Thanks for the link. Altough in moylop260's scenario, ``Overwrite existing terms`` is not checked.

In my example, it is indeed checked and get the same problem.

Penulis Jawaban Terbai

I found out that in the po file, a word was translated twice as Ray said. had to look carefully for each line to get the wrong one.

Avatar
Buang

Okay, how we can find duplicates? I have more than 3000 translation terms.

Jawaban Terbai

@Ibrahim Boudmir

To check for duplicate lines in your .po file, you can use Poedit https://poedit.net/, which will alert you directly if there are any duplicates.

Avatar
Buang
Jawaban Terbai

hi @ibrahim

i had the same issue , its because i installed a module version 11 in 12 version , if it's your case try to adapt your file lang.po  with version 12

Avatar
Buang
Jawaban Terbai

Did you figure out how to fix it? I've updated odoo 12 to latest version. The 2 modules that I've migrated from odoo 10, I've exported the translation form odoo 12 and replaced the translation files in models.

But I still get the error when I want to add the language with override terms.


Avatar
Buang

after that you cloud just run load translation with option Overwrite existing terms or did you have to remove the module first? Thanks

Penulis

overwrite existing terms won't delete redundant translations from your po file.

you need to figure out what translation is declared twice or more in it.

Post Terkait Replies Tampilan Aktivitas
2
Jul 20
5491
0
Des 24
1779
2
Feb 24
3269
2
Des 23
15539
4
Nov 23
3965