How to view all the variables available in the dictionary variable of any document, as in the Purchase and Sales Invoices?

How do we see what is inside the doc dictionary variable for the Sales Invoice? We need to be able to see what information is available in this variable for printing.

You can do:


This is the error we get:

{{ undefined value printed: access to attribute '__dict__' of 'SalesInvoice' object is unsafe. }}

Where are you using it? You can use it in console and then, when you know the information, use the information in the code. __dict__ is not mean to be used in the code, it’s just to know the properties of an object in console.

If you want one to use in code, you can use:

doc.as_dict(no_nulls=False, no_default_fields=False, convert_dates_to_str=False)
1 Like