Hi All,
i created a new field Purchase price in item transaction if i enter value in it should autocreate in item price transaction with standard buying price list.
Thanks in Advance
NCP
August 22, 2024, 9:12am
2
You can easily do this using the server script. please check the reference below:
Hi @ramalyb ,
Please apply the server script in your custom app.
Please add in hooks.py
doc_events = {
"Supplier Quotation": {
"on_submit": "custom_app.custom_app.doc_events.insert_item_price",
}
}
import frappe
def insert_item_price(doc, method):
# Iterate through items in the Supplier Quotation
for item in doc.items:
# Create a new Item Price record
item_price = frappe.new_doc("Item Price")
item_price.item_code = item.item_code
item_price.price_l…
Hi @pm23 ,
Please check the post.
syntax like (Server Script)
def on_update(doc, event):
# Create a new Latest Purchase Price document
lpp_doc = frappe.new_doc("Latest Purchase Price")
lpp_doc.item_name = doc.item_name
lpp_doc.item_code = doc.item_code
lpp_doc.updated_date = frappe.utils.now_datetime()
lpp_doc.rate = doc.rate
lpp_doc.insert(ignore_permissions=True)
When you save the Item and Latest Purchase Price will be created. So ha…
1 Like