Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // for image from attachment
- // takes the selected image and creates
- // a table with image in HTML
- // in the "ref_image" field
- console.log (" Custom code working fine ")
- cur_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></tr>'+
- '</table>', {imgurl: wn.utils.get_file_link(!doc.image)});
- refresh_field('ref_image');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement