ya in address there is no item.
I want to fetch list of Item from Item Doctype
Do you have any reference of item in Address Template.
What is your use-case?
No dont have any reference.
Give me a sample to fetch from another doctype with reference
here doc.customer is reference.
{{ frappe.db.get_value(‘Customer’, doc.customer, ‘customer_type’) }}
I have given this in address doctype
Im getting error as
Traceback (innermost last):
File “/home/vaijeyanthi/frappe-bench/apps/frappe/frappe/app.py”, line 51, in application
response = frappe.handler.handle()
File “/home/vaijeyanthi/frappe-bench/apps/frappe/frappe/handler.py”, line 69, in handle
execute_cmd(cmd)
File “/home/vaijeyanthi/frappe-bench/apps/frappe/frappe/handler.py”, line 92, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/vaijeyanthi/frappe-bench/apps/frappe/frappe/init.py”, line 751, in call
return fn(*args, **newargs)
File “/home/vaijeyanthi/frappe-bench/apps/frappe/frappe/templates/pages/print.py”, line 107, in get_html
html = template.render(args, filters={“len”: len})
File “/home/vaijeyanthi/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py”, line 969, in render
return self.environment.handle_exception(exc_info, True)
File “/home/vaijeyanthi/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py”, line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File “”, line 1, in template
TemplateSyntaxError: unexpected char u’&’ at 103
please remove curly brackets,
frappe.db.get_value('Customer', doc.customer, 'customer_type')
Can you share your print format?
if i remove curley brackets. it just printing
frappe.db.get_value('Customer', doc.customer, 'customer_type')
the same
can you share your print format?
Ohh, you are using print format builder.
Please check my images
Steps:
- in print format builder UI, Drag Custom HTML into location you want to print.
- Click on Edit Html
- write this code {{ frappe.db.get_value(‘Customer’, doc.customer, ‘customer_type’) }}
- refresh your print format. This will show customer details as Individual
Ok … Thankyou… Its working
@kolate_sambhaji: Hi Sambhaji,
I have address as a linked field in a doctype. All entries made while filling this DocType are storedas entries under “Address” DocType. When I want to print our the entire address in the print, how do I reference the particular address that is linked to this document? I hope this makes sense.
@Rohan_J You need to fetch address using Address template, then you can print it.
e.g.1 purchase common.js
//on selecting address in shipping_address full address is copied into shipping_address_display
shipping_address: function(){
var me = this;
erpnext.utils.get_address_display(this.frm, "shipping_address",
"shipping_address_display", is_your_company_address=true)
},
e.g.2
cur_frm.cscript.buyer = function() {
erpnext.utils.get_address_display(this.frm, "buyer", "buyer_address");
};
//buyer is address field, and on select of buyer, I am fetching full address in buyer_address
Hi @kolate_sambhaji,
“get_address_display” is not working in v8, can you suggest changed method for v8?
Thanks
Edit: found the solution
Replace: erpnext.utils.get_address_display
with : frappe.geo.doctype.address.address.get_address_display
Hi @kolate_sambhaji
I am trying to create custom reports
any reference where i can start learning
what all language should i know
thanks
hemanth
Welcome krishnanhemanth
There’s this if you have not seen it
Thanks for the reply clarkej
iam building custom reports for printing
for example sales invoice wrt my company standards
i go to customise
then pick or delete elements and click update
but nothing gets updated in the print
dont know whats wrong
hemanth
Hi clarkej
Begining to get a feel of this
iam attaching a sample invoice
i want to get the bottom elements into the main section
how do i do it
plz help
regards
Hemanth
Is that possibly an Item line item element from an Items table?
I seek working examples to learn how the Items table works.
I found these for ideas
Have you any favourite pointers to share?