Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's not possible to explicitly request translated values for a record #2

Open
diggy128 opened this issue Sep 20, 2015 · 0 comments
Open

Comments

@diggy128
Copy link

As I've mentioned over to Willow It's github it's not possible to request a translation for a record for a language other than the openERP's user language.

This makes it impossible to use the resultset for reporting purposes where the report language must be controlled.

Specifically as mentioned in the issue above:

  • context is just parsed once when opening the session via XML-RPC fetching its value from the action calling the report.
  • There are separate getters and setters for language, timezone and active_test but ARE NOT USED ANYWHERE.

This means that there is no way to explicitly change the translation language for a record; language is controlled by active user's language set in openERP.

The point is though that there is no way to create a report in another language (eg a partner's language)

This could relatively easy be fixed by:
In openERP report helper UI:
Adding a radio button to pick with labels:
Translation Language

    1. Follows openERP user's Language (current implementation)
    1. Set explicitly to: (res.lang dropdown values)
    1. Set from field in data source (model field list dropdown, with default value to fall back to)
    1. Set from function (function that evaluates to a language string, with default value to fall back to)

Of the above 3 and 4 will allow to have each record translated to a different language and will be quite expensive as they will require different read operations for each id that has a different language. This could maybe be partly off-set by first sorting by lang > performing the reads grouped for each lang > merging the resultsets > resorting results by the requested order. The case is though that such reports will likely have a small number of records selected (eg when batch printing invoices).

In openERP java API:

  • Parse context and set context_lang value if not set explicitly

I would code the changes myself and contribute back, but my last contact with java was 6 years ago (developing a javaME app for exVAN invoicing) so I am less than proficient to do with without taking too much time and breaking things.

Finally, two other things to try to implement would be:

  1. A way to have multiple translations for each record (currently very hard to achieve) and
  2. Fetching the translated labels for fields

Regards,

Dimitrios Tanis

@diggy128 diggy128 changed the title It's not possible to explicitly request a translated for a record It's not possible to explicitly request translated values for a record Sep 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant