Changing product name changes only translation

There is a recurrent issue which was also present in Oerp relating to updating product names.

If the language is set to anything other than english, then only the translation is changed - leaving inconsistency in the database.

This is really noticeable when such a product having had its name change is duplicated to create a new product, and renamed accordingly. In the base there will be numerous products with the same name, only the translated name is different. (at least in Oerp the name had ‘(copy)’ appended).

I believe there should be a means for installations to disable translation for products, only needed primarily for multilingual installations where there is already extra effort necessary to manage such details.

By the way, the same issue exists for units of mesure, categories, attributes…

If you are only using one language you just have to set the main language in the configuration file

okay, super.
BTW in order to do the migration we needed to use ‘en’ such that the proteus script could correctly deal with a number of things (namely xml tags and such).
Is it possible to retrofit now, after the fact? I suppose it would mean off-lining and copying all the pertinent values in ir_translation for ALL the translated fields… anybody done this? I’m sure willing to try.

I finally found some time to work on this… but I don’t notice anything difference.

That is, I planned on updating the relevant base class names with the latest value from ir_translation
then delete those ir_translation table records, but first I tried some experimenting (with 5.2)

I created a new base with only ‘fr’ as language and, among others, I activated the module ‘stock’
I added a warehouse and a storage zone that I use for both input and output.

I check via pgadmin4 that stock.location has these and I notice in ir_translation that there is a translation to ‘fr’ for these.

I go back and rename in tryton the new warehouse and the storage zone created.
But only the translation table for French is updated, the original name is still there both in base and as the src field in the translation.

In other words, nothing is different.

If I correct everything now, it is only temporary until the first rename (typically a duplication).

How to really correct this mess?

So you did not follow Changing product name changes only translation so do not expect different result.

? I believe I did, as I have the following in my config file:

[database]
path = /var/lib/trytond
language = fr
uri = postgresql://tryton@:6432

this was for creation as well as for usage

I seem to be able to advance by brute forcing via psql ir_configuration.language to ‘fr’ and subsequently de-ticking translateable for Anglais(english) in Administration->Localisation->Language

Now when I rename the base class name it seems to work as sergi hinted… the base class is updated (as well as the records in ir.translation)

Seems care is needed where the translation is needed and the french tables need to remain where there are english ones… two examples I’ve come across so far are ‘stock.location’ and ‘product.uom’.

So I’ll pursue scripting this up in a test copy til I’m satisfied, when conclusive and successfully integrated, I’ll mark this post as solved.

BTW, any hints on how to change the default language in proteus?
The following gives me TypeError: create is not callable

Config = Model.get('ir.configuration')
defconf = Config()
if defconf.language != 'fr':
    defconf.language = 'fr'
    defconf.save()

In the end is it OKAY to delete the ir.translation records after correction of the base record
or should these records be kept, after updating src?

It appears by default, even if the base language is ‘fr’ and for example a product template is
created, tryton still creates an ir.translation record for lang=‘fr’ and name=‘product.template,name’
with src and value being the same as name in product.template…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.