Stock Entry default From warehouse


i wonder how i can set default from warehouse to be as the same as item default warehouse when we create stock entry?


It's a good feature request, we will add it in the product. Can you please create an issue in github?

Hi, its done Preselect Stock entry warehouse · Issue #2461 · frappe/erpnext · GitHub

anyway can we make the warehouse have different name between the chart of account and the warehouse name, because the accountant want to set their name, and the user didnt know that…
i wonder if i can create new custom filed that has select type and when the combobox selected it will automatically set the destination warehouse, can it be done?


You can rename the warehouse account, it will work.

Hi, and for the selector can it be done (because for some roles the wont know all warehouse, just some specific warehouse)?, because i want to change desination warehouse to be combobox with list name to make the user easier to understand


You mean, there are multiple accounts for a single warehouse or there are duplicate warehouses and subsequent warehouse?

If there are duplicate warehouse, then you can merge them.

Nope , not multiple warehouse , here my cases :
i had warehouse
Work In Progress - ERP
11411-Persediaan Barang Jadi - ERP
11421-Persediaan Barang Setengah Jadi - ERP
11422-Persediaan Barang Dipihak Ketiga - ERP
11431-Persediaan Bahan Baku - ERP
11432-Persediaan Bahan Pembantu - ERP
11433-Persediaan Supplies & Spare Part - ERP
11435-PERSED. Bhn Pembantu-Cairan - ERP
11436-Persed. Bhn Pembantu-Packaging - ERP
11437-Persediaan-Pisau Plong - ERP
11438-Persediaan-Lasting - ERP
11439-Persediaan-Moulding - ERP
11441-Persediaan Dalam Perjalanan - ERP
11451-Persediaan - Waste - ERP

but to make the user not confused due too many warehouse , because they will not accessed it all i want :

  1. set the default source warehouse (which you said it will be added so we can set it in master item from default warehouse)
  2. The destination warehouse i dont want to show it all i will just set some warehouse to be the destinated warehouse , because for some user they will just need to see some of the warehouse not all, so i want to create 1 helper filed that when the filed is selected the destined warehouse will be selected automatically
    for example destinated warehouse that used for manufacturing or material transfer is just :
    11411-Persediaan Barang Jadi - ERP
    11421-Persediaan Barang Setengah Jadi - ERP
    11422-Persediaan Barang Dipihak Ketiga - ERP

so ill just make them to select what is the purpose like :
manufature finished good >> 11411-Persediaan Barang Jadi - ERP
manufature still in pogress >> 11421-Persediaan Barang Setengah Jadi - ERP
subcontaracting >> 11422-Persediaan Barang Dipihak Ketiga - ERP

i hope this can explain what i wanted to


To achieve this, you should write some custom script, which will set those warehouses in on_change event of Purpose field. Same will be set on on_change of Item field.


is there any example for that?

and anyway how can i make this custom field only appear when target warehouse is appear?


No direct exapmle, but you can look into the below function to get an idea.


So i should change that js ?.. i think i supposed to do it in client side via web interface and not change the default erpnext script ?


No, you can add client script from the web interface. Create new “Custom Script” for “Stock Entry” doctype.

Hi Nabin,

As far as i studied the js i think i want to know line 390 - 407 , please correct me if im wrong , in those line the script is about when an item code is selected then load the item details and put it into form , right?
if yes i think i can add the source warehouse details there , but i need to know what is get_server_fields function do , and where is it?
and for the target warehouse i cant understand yet , this what was i do for now , im added custom script to stock entry detail :
cur_frm.cscript.tujuan = function(doc) {
var me = this;
this.set_warehouse_if_missing(“t_warehouse”, doc.to_warehouse, function(row) {
return me.target_mandatory.indexOf(me.frm.doc.purpose)!==-1;
just to show or hide the purpose field but it didnt work
and for the on change :
cur_frm.cscript.custom_tujuan = function(doc) {
if (doc.tujuan==“Produksi”){
cur_frm.set_value(“t_warehouse”,“Work In Progress”);

but its not work too, please help