ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

How to load add_fetch automatically on creation


#1

Hi,

thank you for helping me, I am new to ERP.

when I create a new sales order, the document automatically fetches default shipping address and billing address. Nevertheless our instance of erpnext doesn’t automatically load the following custom script values.

cur_frm.add_fetch(“customer_address”, “email_id”, “sales_invoice_billing_email”);
cur_frm.add_fetch(“shipping_address_name”, “email_id”, “sales_invoice_shipping_email”);
cur_frm.add_fetch(“shipping_address_name”, “warehouse”, “set_warehouse”);
cur_frm.add_fetch(“shipping_address_name”, “warehouse_order_email”, “sales_warehouse_email”);

How can I load them automatically even when the addresses are autocompiled by erpnext upon creation of the sales order?

Fabian