Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

how to load a translation with json rpc ?

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
translationsodoojsonrpc
2 Besvarelser
6405 Visninger
Avatar
Duan Fang

how to load a translation with jsonrpc(python lib odoorpc) ?

thanks !

0
Avatar
Kassér
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Bedste svar

Hi,

Try like following

from odoorpc import ODOO

# Connect to the Odoo server
odoo = ODOO('localhost', port=8069)
db_name = 'your_database'
user = 'your_username'
password = 'your_password'
odoo.login(db_name, user, password)

# Get the JSON-RPC client from the ODOO instance
jsonrpc = odoo.jsonrpc

# Load the translation module
module_name = 'base' # Replace with the module name you want to load translations for
jsonrpc.load_module(module_name)

# Logout from 

In the above code, you first establish a connection to the Odoo server using the ODOO class from the odoorpc library. Then, you log in to the Odoo server using the login method with your database name, username, and password.

Next, you retrieve the JSON-RPC client object from the odoo instance. The jsonrpc object allows you to perform JSON-RPC requests to the Odoo server.

To load the translation module, you use the load_module method of the jsonrpc client and provide the name of the module you want to load translations for. In the example, 'base' is used as an example module name. Replace it with the actual module name you want to load translations for.

Finally, you log out from the Odoo server using the logout method to close the session.

Remember to replace 'localhost', 8069, 'your_database', 'your_username', and 'your_password' with the appropriate values for your Odoo server configuration

Regards

0
Avatar
Kassér
Avatar
shubham shiroya
Bedste svar

To load a translation using JSON-RPC in the Python library odoorpc, you can use the execute_kw method to call the load_module_translation method of the ir.module.module model in Odoo.

from odoorpc import ODOO

# Establish a connection to the Odoo server
odoo = ODOO(host='your-odoo-host', port=8069)
db_name = 'your-database-name'
user = 'your-username'
password = 'your-password'
odoo.login(database=db_name, login=user, password=password)

# Specify the module name for which you want to load the translation
module_name = 'your-module-name'

# Call the load_module_translation method to load the translation
module_obj = odoo.env['ir.module.module']
result = module_obj.execute_kw('load_module_translation', [module_name])

# Check the result of the translation loading operation
if result:
print('Translation loaded successfully.')
else:
print('Translation loading failed.')

# Logout from the Odoo server
odoo.logout()

Note: Ensure that you have the odoorpc library installed in your Python environment before running the code. You can install it using pip: pip install odoorpc.
0
Avatar
Kassér
Enjoying the discussion? Don't just read, join in!

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

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
How do I change the translation of a single word of an inherited module? Løst
translations odoo
Avatar
Avatar
Avatar
3
nov. 21
6996
Part of Odoo not translated Løst
translations odoo
Avatar
Avatar
Avatar
2
mar. 15
6851
jsonrpc bulk write
api odoo jsonrpc
Avatar
Avatar
1
apr. 25
1809
Odoo JsonRPC : Get m2m, m2o or o2m nested field with read method
odoo jsonrpc odoo17
Avatar
0
feb. 25
1898
Ionic 5 and Odoo connection got error on handling json response
api odoo jsonrpc
Avatar
0
jan. 21
4352
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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