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

QWeb report not translated #35553

Closed
sabba opened this issue Aug 8, 2019 · 12 comments
Closed

QWeb report not translated #35553

sabba opened this issue Aug 8, 2019 · 12 comments
Labels
Internationalization about translations

Comments

@sabba
Copy link

sabba commented Aug 8, 2019

Hello,
I'm having troubles trying to generate a translated custom report.

So, I tried to test the translation framework on a standard module and I'm not able to generate translated PDF/HTML.

I have used the purchase module as explained below.
Where I'm wrong?

I have also tried on this demo instance without success: https://demo3.odoo.com/

Thank you!


Impacted versions:
Odoo 12.0-20190424 - latest docker image (ID: cd4d666c0dc5)

Steps to reproduce:

  • New Database installation NOT in english. In my test "Italian"
  • Installation of Purchase module
  • Check admin user has languange set into preferences (my test "Italian")
  • Create a new RFQ/Order
  • Print PDF Order (or access to /report/html/purchase.report_purchaseorder/1)

Current behavior:

  • Report NOT translated (pdf and html)

Expected behavior:

  • Report translated according to translated terms that seems to be correctly loaded

Video/Screenshot link (optional):


Installed Languages
image


User Preferences
image


Translated Terms
image


Example of RFQ
image


PDF output
image


HTML output
image

@Yenthe666 Yenthe666 added the Internationalization about translations label Aug 8, 2019
@pedrobaeza
Copy link
Collaborator

RfQ / Purchase order is translated in the language of the supplier, so that's something expected. Change the language of your supplier and try again.

Closing meanwhile and this is working correctly in my side.

@sabba
Copy link
Author

sabba commented Aug 8, 2019

Hello @pedrobaeza
Thank you for the answer.

You are right, RFQ/Purchase Order is translated in the language of the supplier.

image

I'm sorry for the error into the description, but the translation does not work anyway. :(

As I described before I have created a DB with only one language installed . Whereby in my example the supplier language was the only one available (Italian), as you can see in this screen

image

But my instance continues to generate english report (obviously I'm trying on a fresh new installation with the only purchase module installed).

Am I losing something or is a problem of the dockerized instance I'm using?
Thank you again!

@pedrobaeza
Copy link
Collaborator

Have you loaded translations from Settings > Translation > Load a translation?

@sabba
Copy link
Author

sabba commented Aug 8, 2019

Yes, many times. With and without overwriting terms.

As you can see in one of the screenshot i put in my first message, the strange thing is that terms seem to be correctly translated and loaded into the DB, but simply not applied during template rendering. :(

image

@pedrobaeza
Copy link
Collaborator

OK, let's reopen this and this is not possible to try on runbot as it creates directly DBs on English.

@mart-e have you observed this problem?

@pedrobaeza pedrobaeza reopened this Aug 8, 2019
@mart-e
Copy link
Contributor

mart-e commented Aug 8, 2019

this is not possible to try on runbot as it creates directly DBs on English

You can achieve the same by loading Italian, switching all users to Italian and deactivating English language

Your issue is quite odd, I just tried and had no issue.
One way to get that is if you set no language on the supplier. Setting no language means using the "raw" values in the database, hence English (but it does not seem to be the case here cf your screenshot).

@sabba
Copy link
Author

sabba commented Aug 8, 2019

If useful, this is my full odoo.conf

[options]
addons_path = /mnt/extra-addons
data_dir = /var/lib/odoo
admin_passwd = admin
load_language = en_US
lang = en_US
csv_internal_sep = ,
db_maxconn = 64
db_name = backend
db_template = template1
dbfilter = .*
debug_mode = True
auto_reload = True
email_from = False
without_demo = all
limit_memory_hard = 2684354560
limit_memory_soft = 2147483648
limit_request = 8192
limit_time_cpu = 60
limit_time_real = 120
list_db = True
log_db = False
log_handler = [':DEBUG']
log_level = debug
logfile = None
longpolling_port = 8072
max_cron_threads = 1
osv_memory_age_limit = 1.0
osv_memory_count_limit = False
smtp_password = False
smtp_port = 25
smtp_server = localhost
smtp_ssl = False
smtp_user = False
workers = 0
xmlrpc = True
xmlrpc_interface =
xmlrpc_port = 8069
xmlrpcs = True
xmlrpcs_interface =
xmlrpcs_port = 8071
proxy_mode = False

And this is my docker-compose.yml file

version: '3'
services:
  odoo:
    image: odoo:12.0
    networks:
      - administrative
    depends_on:
      - odoodb
    ports:
      - "8069:8069"
    command: ["odoo", "-d", "backend", "--dev=all"]
    stdin_open: true
    tty: true
    environment:
      - HOST=odoodb
      - USER=odoo
      - PASSWORD=odoo
    volumes:
      - odoo-web-data:/var/lib/odoo
      - ./conf/odoo.conf:/etc/odoo/odoo.conf
      - ./addons:/mnt/extra-addons
  odoodb:
    image: postgres:11
    networks:
      - administrative
    environment:
      - POSTGRES_DB=backend
      - POSTGRES_USER=odoo
      - POSTGRES_PASSWORD=odoo
      - PGDATA=/var/lib/postgresql/data/pgdata
    stop_grace_period : 120s
    volumes:
      - odoo-db-data:/var/lib/postgresql/data/pgdata
volumes:
  odoo-web-data:
  odoo-db-data:
networks:
  administrative:

@mart-e
Copy link
Contributor

mart-e commented Aug 8, 2019

Sorry, the only explanation I find is the supplier having no language set.
I don't use docker but I don't think it has an impact...

@intero-chz
Copy link
Contributor

@sabba remove --dev=all from your docker compose file.

@mart-e
Copy link
Contributor

mart-e commented Aug 12, 2019

@intero-chz good catch!
Indeed the dev mode bypass the translation system as the view content is loaded directly from the files and not the database.

@sabba
Copy link
Author

sabba commented Aug 12, 2019

Thank you @intero-chz! :-)

I will try as soon as possibile, I'm out of office and I don't have my notebook.

@sabba
Copy link
Author

sabba commented Aug 14, 2019

Hello.
I have just run a test removing --dev=all and.... it works as expected!

Thank you for the support and for your time!
I'm sorry for this non-issue, but I have learned something new!

@sabba sabba closed this as completed Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internationalization about translations
Projects
None yet
Development

No branches or pull requests

5 participants