This question has been flagged
3 Replies
15910 Views

I need an explanation for the get_object_reference function

Avatar
Discard
Best Answer

From the method docstring:

Returns the id of the ir.model.data record corresponding to a given module and xml_id (cached) or raise a ValueError if not found

In other words, it will get id of record, imported to database from xml.

Avatar
Discard
Author

thank you for your clear explanation

Best Answer

Hello Maniganda, Nazarii, 

What is the difference between get_object and get_object_reference?

Avatar
Discard

get_object returns a browsable record for the given module name and xml_id.

get_object_reference the database ID only