Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

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

Naroči se

Get notified when there's activity on this post

This question has been flagged
xmlrpcversionsmethodsir.model.data
2 Odgovori
7636 Prikazi
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
Opusti
Avatar
Carlos Enrique
Avtor 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
Opusti
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
Opusti
Carlos Enrique
Avtor

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!

Prijavi
Related Posts Odgovori Prikazi Aktivnost
Odoo v15: XMLRPC changed 'get_object_reference' shortcut to '_xmlid_lookup'
xmlrpc ir.model.data v15
Avatar
Avatar
1
nov. 22
4775
export record programmatically, session_id mssing Solved
export session xmlrpc session_id ir.model.data
Avatar
1
apr. 16
5476
xmlrpc Error when attempting to connect to my local instance Solved
xmlrpc
Avatar
Avatar
Avatar
3
jul. 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
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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