Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
31436 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ

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

Tác giả

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.

Tác giả Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ

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

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.


Ảnh đại diện
Huỷ bỏ

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

Tác giả

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.

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 7 20
5288
0
thg 12 24
1488
2
thg 2 24
3044
2
thg 12 23
15047
4
thg 11 23
3516