Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Translating a Studio report into the contact's language

Subscriure's

Get notified when there's activity on this post

This question has been flagged
reportstudioquickstart
2 Respostes
5572 Vistes
Avatar
Lukas Van Cauter (cvl)

  1. Translating a Studio report into the contact's language
3
Avatar
Descartar
George Mountanos

Hi Lukas, 

Everything great!

Thanks so much for the answer, it seems like I have a few more things to take care of before I can actually translate it, but that's ok. 

Thanks so much again!

Have a great day, 

George

Avatar
Lukas Van Cauter (cvl)
Autor Best Answer

Problem: A custom made report (with Studio) is printed (or the pdf is generated) with all the fields translated into the language of the user in Odoo, instead of the language of the contact for whom the report is intended.

Use case: A newsletter is sent to the contacts of a company. Of course, this should be in the language of the contact that will receive the letter. The goal is that fields like for example the title of a contact (mister, miss) are translated into the language of the receiving person.

Cause: In reports such as an invoice (translated into the contact’s language by default), a context is added in the XML code to indicate this. This XML code is missing if you create a report in Studio from scratch.

Solution: Add this piece of code in the XML code:

<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)" />

What it means in human language: we’re adding a context to this report, which sets the language of the report to the language of the partner that’s present in the document from which we’re generating the report.

How to get the language?

If you are generating a report from the contacts app (as in the example above), you just need the value of the language field -> doc.lang

If you are generating a report from an app like accounting, there is an extra step to go through the contact itself -> doc.partner_id.lang

 

Step by step guide

1) Go to the report you created in Studio

2) Go to Report -> XML (the developer mode has to be activated)

3) In the dropdown, select the one that starts by studio_customization. and ends with _document.

 

4) Copy the entire thing: “studio_customization.studio_report_docume_c8a3a442-df5c-4463-96cd-c90eb64439cb_document”

5) Go (in debug mode) to the views in the technical settings

6) Search for the line you copied in step 4

7) Open the one where the ‘key’ is the same as the line you copied

8) Add the piece of code

3
Avatar
Descartar
Julian Sautter (jus)

Great article, thank you Lukas, unblocked me with a report I had this issue with!

George Mountanos

Hi Lukas,

Hope all is good!
Your post seems to be exactly what I have been looking for.
Unfortunately, I get stuck at step 3.
If you could help, I would be grateful!
What should I chose?
https://drive.google.com/file/d/17iWtKPasTfv7lpuOj3RsjoFUE12Y-jB1/view?usp=sharing

Thanks in advance!

Kind regards,
George

Lukas Van Cauter (cvl)
Autor

Hi George! All fine here, hope the same for you.

This should be the one: https://tinyurl.com/2mp86ah6
Let me know if it works!

Kind regards,
Lukas

Avatar
Ellen Wouters
Best Answer

Hi Lukas,


I am trying to translate my delivery slip (created in Odoo Studio) into the customers language.

However, it keeps generating it in Dutch.

I have added the formula:

t t-name="studio_report_document">

 

                 

 

               


Seems like I am doing something incorrect.


Thanks, Ellen


0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
odoo studio V16- how to sort a table in an odoo studio report
report studio
Avatar
Avatar
1
de març 24
3524
How to edit the size of a field on pdf report with studio Solved
studio quickstart
Avatar
Avatar
1
d’oct. 21
5818
Customize Reports in Studio- Odoo V13
report studio
Avatar
0
de nov. 19
8
How to make a report invisible depending on the company Solved
report studio v18
Avatar
Avatar
Avatar
2
de set. 25
1154
How to set up a dynamic date filter with studio ?
filtering studio quickstart
Avatar
Avatar
Avatar
Avatar
Avatar
5
d’oct. 24
13574
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now