How imports work in frappe

I want to import a function from a .py file inside a doctype
how can i import get_qr_code() from assest folder into

file path of get_qr_code()
apps/erpnext/erpnext/assets/ contains get_qr_code()

file path of

so give import statement for importing get_qr_code() into

All Frappe apps are python packages. So imports start with appname.

In your case it would be:

from erpnext.assets.qr_code import get_qr_code

1 Like