Skip to Content
Menu
This question has been flagged
1 Reply
3521 Views

Hello, I created a form for creating specific reports. I followed all the instructions in the guides but the translation remains incomplete. The module is divided into 1 report, 1 wizard and a model. As for the model, it inherits and adds a button (it is not translated), the wizard is translated, only the treeview remains in English, nothing is translated for the report.
I don't understand why despite the translated terms in the .po file they are not displayed.

Did I forget to do something?


UPDATE return this error when update language

 2020-03-18 09:48:49.093 UTC [58] ERROR:  ON CONFLICT DO UPDATE command cannot affect row a second time
 2020-03-18 09:48:49.093 UTC [58] HINT:  Ensure that no rows proposed for insertion within the same command have duplicate constrained values.
 2020-03-18 09:48:49.093 UTC [58] STATEMENT:   INSERT INTO ir_translation(name, lang, res_id, src, type, value, module, state, comments)
                              SELECT name, lang, res_id, src, type, value, module, state, comments
                              FROM tmp_ir_translation_import
                              WHERE type = 'model'
                              AND noupdate IS NOT TRUE
                              ON CONFLICT (type, lang, name, res_id) WHERE type = 'model'
                               DO UPDATE SET (name, lang, res_id, src, type, value, module, state, comments) = (EXCLUDED.name, EXCLUDED.lang, EXCLUDED.res_id, EXCLUDED.src, EXCLUDED.type, EXCLUDED.value, EXCLUDED.module, EXCLUDED.state, EXCLUDED.comments)
                               WHERE EXCLUDED.value IS NOT NULL AND EXCLUDED.value != '';
                          
 2020-03-18 09:48:49,099 55 ERROR donodoo odoo.sql_db: bad query:  INSERT INTO ir_translation(name, lang, res_id, src, type, value, module, state, comments)
                            SELECT name, lang, res_id, src, type, value, module, state, comments
                            FROM tmp_ir_translation_import
                            WHERE type = 'model'
                            AND noupdate IS NOT TRUE
                            ON CONFLICT (type, lang, name, res_id) WHERE type = 'model'
                             DO UPDATE SET (name, lang, res_id, src, type, value, module, state, comments) = (EXCLUDED.name, EXCLUDED.lang, EXCLUDED.res_id, EXCLUDED.src, EXCLUDED.type, EXCLUDED.value, EXCLUDED.module, EXCLUDED.state, EXCLUDED.comments)
                             WHERE EXCLUDED.value IS NOT NULL AND EXCLUDED.value != '';
                        
 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.
  
 
 > /usr/lib/python3/dist-packages/odoo/sql_db.py(225)execute()
 -> res = self._obj.execute(query, params)
 (Pdb) 2020-03-18 09:48:49,100 55 ERROR donodoo odoo.http: Exception during JSON request handling. 
 Traceback (most recent call last):
   File "/usr/lib/python3/dist-packages/odoo/http.py", line 656, in _handle_exception
     return super(JsonRequest, self)._handle_exception(exception)
   File "/usr/lib/python3/dist-packages/odoo/http.py", line 314, in _handle_exception
     raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
   File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 87, in reraise
     raise value
   File "/usr/lib/python3/dist-packages/odoo/http.py", line 698, in dispatch
     result = self._call_function(**self.params)
   File "/usr/lib/python3/dist-packages/odoo/http.py", line 346, in _call_function
     return checked_call(self.db, *args, **kwargs)
   File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 97, in wrapper
     return f(dbname, *args, **kwargs)
   File "/usr/lib/python3/dist-packages/odoo/http.py", line 339, in checked_call
     result = self.endpoint(*a, **kw)
   File "/usr/lib/python3/dist-packages/odoo/http.py", line 941, in __call__
     return self.method(*args, **kw)
   File "/usr/lib/python3/dist-packages/odoo/http.py", line 519, in response_wrap
     response = f(*args, **kw)
   File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 966, in call_button
     action = self._call_kw(model, method, args, {})
   File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 954, in _call_kw
     return call_kw(request.env[model], method, args, kwargs)
   File "/usr/lib/python3/dist-packages/odoo/api.py", line 759, in call_kw
     return _call_kw_multi(method, model, args, kwargs)
   File "/usr/lib/python3/dist-packages/odoo/api.py", line 746, in _call_kw_multi
     result = method(recs, *args, **kwargs)
   File "/usr/lib/python3/dist-packages/odoo/addons/base/wizard/base_language_install.py", line 36, in lang_install
     mods.with_context(overwrite=self.overwrite)._update_translations(self.lang)
   File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 885, in _update_translations
     self.env['ir.translation'].load_module_terms(mod_names, filter_lang)
   File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_translation.py", line 825, in load_module_terms
     tools.trans_load(self._cr, trans_file, lang, verbose=False, module_name=module_name, context=context)
   File "/usr/lib/python3/dist-packages/odoo/tools/translate.py", line 1016, in trans_load
     result = trans_load_data(cr, fileobj, fileformat, lang, verbose=verbose, module_name=module_name, context=context)
   File "/usr/lib/python3/dist-packages/odoo/tools/translate.py", line 1160, in trans_load_data
     irt_cursor.finish()
   File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_translation.py", line 156, in finish
     """ % (self._model_table, self._table))
   File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 148, in wrapper
     return f(self, *args, **kwargs)
   File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 225, in execute
     res = self._obj.execute(query, params)
 psycopg2.errors.CardinalityViolation: 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.

Avatar
Discard
Best Answer

Hi,

I was got same problem before in odoo 12, i did take latest pull of odoo and issue is solved for me you can try this hope it will work for you


Thanks

Avatar
Discard
Author

Thanks for the information, for the moment I use the same version that we have in production.

Related Posts Replies Views Activity
1
Sep 20
2618
4
Jul 24
5043
2
Jul 24
493
4
Jun 24
22359
3
Apr 24
591