Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Odoo v15: XMLRPC changed 'get_object_reference' shortcut to '_xmlid_lookup'

Odoberať

Get notified when there's activity on this post

This question has been flagged
xmlrpcversionsmethodsir.model.data
2 Replies
7644 Zobrazenia
Avatar
Carlos Enrique

Hello, I need help to understand what has happened in Odoo v15 regarding the 'get_object_reference' method call is now called '_xmlid_lookup'


modifying my migration compiler when I use that method I can't call '_xmlid_lookup' because it is private


Is there another way to get to use the equivalent of self.env.ref('') but for XMLRPC?


In Odoo V13 and Odoo V14 I used:

self.ServerProxyObjects.execute_kw('db', '4', '12345','ir.model.data', 'get_object_reference', ['base.USD'])


In Odoo v15 would be similar:

self.ServerProxyObjects.execute_kw('db', '4', '12345','ir.model.data', '_xmlid_lookup', ['base.USD'])


But _xmlid_lookup is private, result in console:

xmlrpc.client.Fault:xmlrpc.client.Fault: Fault 4: 'Private methods (such as _xmlid_to_res_id) cannot be called remotely


2
Avatar
Zrušiť
Avatar
Carlos Enrique
Autor Best Answer

I found the solution, reviewing the odoo source code I could see that the check_object_reference method does the same thing by calling the _xmlid_lookup method in v15 and in v13 and v14 get_object_reference, so this method would only be called and returns what is desired for all those versions, I will close my question since I found the solution.

4
Avatar
Zrušiť
Kilian Melcher

Worked for me! thanks a lot.

Avatar
Jugert Mucoimaj
Best Answer

Hello bro, I needed to do the same thing. Although I'm getting a strange error. When I give two args it says me "3 were given" when I add only one it says "it needs two but 1 were given." how to solve this?


Thanks

0
Avatar
Zrušiť
Carlos Enrique
Autor

Hello bro,
in v13 to reference a record stored in the db in odoo via XMLRPC, internally odoo has this method

odoo>addons>base>models>ir_model.py line:1728 - 1744

@api.model
def get_object_reference(self, module, xml_id):
"""Returns (model, res_id) corresponding to a given module and xml_id (cached) or raise ValueError if not found"""
return self.xmlid_lookup("%s.%s" % (module, xml_id))[1:3]

which one can call internally via a module like this:

self.env['ir.model.data'].get_object_reference('base_setup', 'action_general_configuration')

with XMLRPC I can call it like this by calling the method that wraps the other called method (check_object_reference) and sending this data

from xmlrpc import client as xmlrpclib
xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format('url')).execute_kw(db, uid, password,
'ir.model.data', 'check_object_reference',
['base', 'user_admin']
)
note: if you want to search for a xml record like 'base.user_admin' you have to send it separately --> 'base', 'user_admin'

which would give you an output in an array with a dictionary of the id number and the model
example: [(1, 'res.partner')] - something like this

I hope my explanation has helped you, if you still have problems tell me the source code maybe it will solve it

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

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
Odoo v15: XMLRPC changed 'get_object_reference' shortcut to '_xmlid_lookup'
xmlrpc ir.model.data v15
Avatar
Avatar
1
nov 22
4778
export record programmatically, session_id mssing Solved
export session xmlrpc session_id ir.model.data
Avatar
1
apr 16
5480
xmlrpc Error when attempting to connect to my local instance Solved
xmlrpc
Avatar
Avatar
Avatar
3
júl 25
4250
Cannot marshal None unless allow_none is enabled
xmlrpc
Avatar
1
okt 24
3104
How to run a method from external api as the superuser
xmlrpc
Avatar
Avatar
1
apr 24
3163
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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