Purchase invoice and Receipt required for asset creation

Hi,
we are trying to create an asset, however it requires us to fill in purchase invoice and purchase receipt, even if it is an existing asset.

However, even when I am trying to make them optional, I cannot as in the customize form they are shown as not mandatory, has anybody encountered this problem?

1 Like

Hi,
-For an existing asset, you can create the asset record directly checking ā€œIs Existing Assetā€ field. In this case, you also need to enter already booked depreciation amount and number of booked depreciation. And based on the input, the system will create a schedule for remaining depreciation.

-For new assets, you cannot create the asset record directly from the Asset form. You need to create a Purchase Receipt/Invoice for it.

For more details refer link Asset

1 Like

I am facing the same issue.
I cannot create asset directly even if checking ā€œis Existing Assetā€ it still require Purchase Receipt/Invoice.

I solved it for us using a custom script
for asset client

frappe.ui.form.on(ā€˜Assetā€™, {
refresh(frm) {
frm.set_df_property(ā€˜purchase_invoiceā€™, ā€˜reqdā€™, 0);
frm.set_df_property(ā€˜purchase_receiptā€™, ā€˜reqdā€™, 0);
}
});

how can i do this custom script?

Search on your ERPNext for Custom Script or go to
YOUR_ERPNEXT/desk#List/Custom%20Script/List (for example http://erpnext.testing.com//desk#List/Custom%20Script/List)
with your browser

Thanks,
i tried to make the script now i get this error:
script-error

issue fixed buy using double quotes instead of single quotes
frappe.ui.form.on(ā€œAssetā€, {
refresh(frm){
frm.set_df_property(ā€œpurchase_invoiceā€, ā€œreqdā€, 0);
frm.set_df_property(ā€œpurchase_receiptā€, ā€œreqdā€, 0);
}
});