Hi, I tried and searched the last 3 hours to solve my problem, but I didn’t find a proper solution.
I’m creating a standard printing format, where people can insert their own letter head, but don’t have to.
If they don’t, a standard header should be shown instead, that also show the correct company_name (and logo).
I’m trying to get the the company_name via: {{ frappe.db.get_value(“setup”, “Company”, “company_name”) }}
but only “None” is returned.
I made it now with :{{ frappe.db.get_value(“Company”, “example company”, “company_name”) }}
But now my problem is to get “example company” dynamically. My idea is to get it from “Global Defaults” → “default_company”, but {{ frappe.db.get_value(“Global Defaults”, “default_company”) }} returns “Global Defaults”
How can I get this value?
Other topic:
Would something like { frappe.db.get_value(“Company”, frappe.db.get_value(“Global Defaults”, “default_company”), “company_name”) }} work in general?
Traceback (innermost last):
File “/home/justadmin/frappe-bench/apps/frappe/frappe/app.py”, line 67, in application
response = frappe.handler.handle()
File “/home/justadmin/frappe-bench/apps/frappe/frappe/handler.py”, line 77, in handle
execute_cmd(cmd)
File “/home/justadmin/frappe-bench/apps/frappe/frappe/handler.py”, line 94, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/justadmin/frappe-bench/apps/frappe/frappe/init.py”, line 788, in call
return fn(*args, **newargs)
File “/home/justadmin/frappe-bench/apps/frappe/frappe/templates/pages/print.py”, line 139, in get_html_and_style
no_letterhead=no_letterhead, trigger_print=trigger_print),
File “/home/justadmin/frappe-bench/apps/frappe/frappe/templates/pages/print.py”, line 118, in get_html
html = template.render(args, filters={“len”: len})
File “/home/justadmin/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py”, line 989, in render
return self.environment.handle_exception(exc_info, True)
File “/home/justadmin/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py”, line 754, in handle_exception
reraise(exc_type, exc_value, tb)
File "