How to add image field fetching from item in item price doctype .I want to add a field image in item price doctype where i can see the image of each item .So when i print also i can view the image.
Customize Item Price and add image field. You can also define in settings of doctype which field contains path to image.
Then in client script for Item Price fetch with this
let image = frappe.db.get_value('Item', frm.doc.item_code, image)
And set value with
frm.set_value('image', image);
frm.refresh_field('image');
frm.save();
- Create a field with fieldtype “Attach Image” in Item Price and hide it if required
- Fetch From: Item → Image
- Mention that fieldname under “Image Field” which is under “Form Settings”. So that you can see the preview in the side bar
To Print:
Use the jinja → <img src={{ doc.image_field_name }}>