Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Consulting
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

how to load a translation with json rpc ?

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
translationsodoojsonrpc
2 Replies
6396 Rodiniai
Portretas
Duan Fang

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

thanks !

0
Portretas
Atmesti
Portretas
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

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
Portretas
Atmesti
Portretas
shubham shiroya
Best Answer

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
Portretas
Atmesti
Enjoying the discussion? Don't just read, join in!

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

Registracija
Related Posts Replies Rodiniai Veikla
How do I change the translation of a single word of an inherited module? Solved
translations odoo
Portretas
Portretas
Portretas
3
lapkr. 21
6985
Part of Odoo not translated Solved
translations odoo
Portretas
Portretas
Portretas
2
kov. 15
6846
jsonrpc bulk write
api odoo jsonrpc
Portretas
Portretas
1
bal. 25
1796
Odoo JsonRPC : Get m2m, m2o or o2m nested field with read method
odoo jsonrpc odoo17
Portretas
0
vas. 25
1891
Ionic 5 and Odoo connection got error on handling json response
api odoo jsonrpc
Portretas
0
saus. 21
4345
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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