You are using a custom script in Setup, or you modified the "sales_order.js" ?
HiI have already asked it on Users forum but only now I realize that this may be the right place to post it.I am trying to add an Image field to Sales Order Item to attach images specific the order only. This may be useful while doing custom work where creation of a new item may feel unnecessary and the image could be added in the order iteself just for the reference. So I feel that the approach being used in Item master could be used here i.e. we attach a photograph, write the description and then generate HTML description combining both.To achieve this, have created 3 custom fields in doctype "Sales Order Item"1. image option: attach_files: Field type: Select2. ref_image Field type: Small Text3. attach_image Field type: Buttonand I have the following custom scriptcur_frm.cscript.attach_image = function(doc, dt, dn) {if(!doc.image) {msgprint(wn._('Please select an "Image" first'));return;}doc.ref_image = repl('<table style="width: 100%; table-layout: fixed;">'+'<tr><td style="width:110px"><img src="%(imgurl)s" width="100px"></td>'+'</table>', {imgurl: wn.utils.get_file_link(doc.image)});refresh_field('ref_image');}The script is not working. When I click the button nothing happens.I suspect something is wrong with the script.I must mention that I have no idea about writing scripts and have tried using the script being used in item master in erpnext.Could someone please point out the mistake in the script? I somehow feel that it would work with little correction.Further, to avoid another ref_image field which would take up another column in the sales order item table, is it possible to replace the contents of the description field with the HTML description containing both description and image??RegardsSatish–
Note:
If you are posting an issue,
- We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
- Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
- For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
End of Note
—
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/9bfca4c4-3741-4310-b67a-7d375e5958ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Maxwell Morais
–
Note:
If you are posting an issue,
- We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
- Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
- For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
End of Note
—
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CABK1YkN5WOkruqDj1%2B2ggzWuGw-2nGBbYxdbeDiv6Z7BSrw56Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.