There's more...

You will probably need to access records with an XML ID from your code sooner or later. Use the self.env.ref() function in these cases. This returns a browse record of the referenced record. Note that here, you always have to pass the full XML ID. Here's an example of a full XML ID: <module_name>.<record_id>. You can see the XML ID of any record from the user interface. For that, you need to activate developer mode in Odoo.

Refer to Chapter 1, Installing the Odoo Development Environment, to activate developer mode in Odoo. After activating the developer mode, open the Form View of the record for which you want to find out the XML ID. You will see a bug icon in the top bar. From that menu, click on the View Metadata option. See the following screenshot for reference:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset