frappe / frappe

Low code web framework for real world applications, in Python and Javascript
https://frappeframework.com
MIT License
6.88k stars 3.3k forks source link

Jinja in Terms and Conditions #14701

Open paulator opened 7 years ago

paulator commented 7 years ago

Hi there,

I want to use Jinja in Terms and Conditions. It works if I use {{ fieldname }}.

But if I want to print a date or a currency then I want to use {{ doc.get_formatted("fieldname") }}. But the object doc is not available.

danielmorlock commented 7 years ago

Using get_formatted is also useful e.g. for formatting the due_date i.e. in the payment conditions.

danielmorlock commented 7 years ago

Workaround to use get_formatted in terms and confitions for doctype Sales Invoice:


frappe.get_doc("Sales Invoice", name).get_formatted("due_date")