Hi,
We have a custom module that defines the confirm attribute of the Confirm button of the Sale model. I will expect to include the translation of such attribute under or custom module but we are failing to do so. Here is my xml definition of such change:
<tryton>
<data>
<record model="ir.model.button" id="sale.sale_confirm_button">
<field name="confirm">Are you sure to confirm the sale?</field>
</record>
</data>
</tryton>
The issue here is that the translation created by the system is related to the sale
module (because the button is created from such module) so we can not update such translation using the standard translation system.
I tried creating an override translation for the Spanish language on the new string but this fails when updating the module:
File "/home/pokoli/.virtualenvs/sale_confirm/bin/trytond-admin", line 7, in <module>
exec(compile(f.read(), __file__, 'exec'))
File "/home/pokoli/projectes/sale_confirm/trytond/bin/trytond-admin", line 23, in <module>
admin.run(options)
File "/home/pokoli/projectes/sale_confirm/trytond/trytond/admin.py", line 57, in run
pool.init(update=options.update, lang=list(lang),
File "/home/pokoli/projectes/sale_confirm/trytond/trytond/pool.py", line 165, in init
restart = not load_modules(
File "/home/pokoli/projectes/sale_confirm/trytond/trytond/modules/__init__.py", line 438, in load_modules
_load_modules(update)
File "/home/pokoli/projectes/sale_confirm/trytond/trytond/modules/__init__.py", line 406, in _load_modules
load_module_graph(graph, pool, update, lang)
File "/home/pokoli/projectes/sale_confirm/trytond/trytond/modules/__init__.py", line 256, in load_module_graph
load_translations(pool, node, lang)
File "/home/pokoli/projectes/sale_confirm/trytond/trytond/modules/__init__.py", line 184, in load_translations
Translation.translation_import(language, module, files)
File "/home/pokoli/projectes/sale_confirm/trytond/trytond/ir/translation.py", line 801, in translation_import
to_save.append(override_translation(res_id,
File "/home/pokoli/projectes/sale_confirm/trytond/trytond/ir/translation.py", line 768, in override_translation
translation, = cls.search(domain)
ValueError: not enough values to unpack (expected 1, got 0)
This problem is because the original translation does not exist in the sale module for the Spanish language as the XML import just created the translation for the English language.
Am I doing something wrong? How can I translate such string?