Hi guys,
i edit print format , edit in reports folder inside the module but there is some doctype doesn’t have printformat or html print inside the report folder ? where could i edit the way this kind of doctype print
Hi guys,
i edit print format , edit in reports folder inside the module but there is some doctype doesn’t have printformat or html print inside the report folder ? where could i edit the way this kind of doctype print
its more like global place to take any print from
Hii @ahmadRagheb
Unless custom_formats are specified in the Print Format, they are printed using the standard.html template, which is further based on the layout
object generated by the make_layout() function.
A layout have multiple pages, a page contains multiple sections, a section contains multiple columns, and a column contains multiple fields which all are grouped so by the make_layout function- either based on a format_data
output from the Print Layout Desginer, or based on the print_hide
& has_value
property of the field in the doc, priority being to the format_data.
Do mind that the above happens if and only if there is no custom_format specified (our own HTML).
You could see that the standard layout is loaded when no other template is found (frappe/printview.py at develop · frappe/frappe · GitHub)
This is a small summary on how prints work when there is no custom_format set in the current Print Format.
Hope it helps!
@fahimalizain it really works for me , first i used this syntax
</table>
but it didn’t work , then i used this one worked and it works fine don’t know why, but it works , if you could told me why that happens ?
{{_(“Printed By”)}}:
{% set u = frappe.get_doc(“User”, frappe.user) %}
{{u.full_name}}
{%= __("Printed By") %}: |
{%= frappe.boot.user.first_name %} {% if (frappe.boot.user.last_name) { %} {%= frappe.boot.user.last_name %} {% } %} |
hii @ahmadRagheb
_ is in python
__ is in JavaScript
for translation function
check this: Syntax of code Frappe Framework - #4 by fahimalizain
So when the template is server side, use the python version
You might be confused because report templates uses JavaScript while print format templates uses python