The osv.osv provides a get_xml_id method to find the XML Id for the provided Database Id.
What is the best way to do the opposite?
Knowing the XML Id (it was defined in the data loading file), how can I get the corresponding Database Id, so that I can refer to it in tour Python code?
The
ir_model_dataobject has a_get_id()method that does what you’re looking for. You can see it in use in theres_users._get_admin_id()method: