Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
4 Odpovědi
31774 Zobrazení

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
Zrušit

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

Autor

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.

Autor Nejlepší odpověď

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
Zrušit

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

Nejlepší odpověď

@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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit

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

Autor

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.

Related Posts Odpovědi Zobrazení Aktivita
2
čvc 20
5490
0
pro 24
1774
2
úno 24
3267
2
pro 23
15536
4
lis 23
3963