Cannot assign value to child table's field

Before v7.1 update, this script did work to set expense account in stock entry detail…but 7.1.15 onwards it doesn’t work…
Expense account are always get overwritten with Stock Adjustment account. Anybody knows why?

frappe.ui.form.on("Stock Entry Detail", "item_code", function(frm, cdt, cdn) {
    var d = locals[cdt][cdn];
    var disc = 0;
    
    if (frm.doc.purpose == "Material Receipt"){
	if (frm.doc.company == "Toko GBU"){
		//d.expense_account = "Capital Stock - tk";
   		frappe.model.set_value(d.doctype, d.name, "expense_account", "Capital Stock - tk");
		
	}
	else{
		d.expense_account = "Capital Stock - pt";
	}

    }
	//refresh_field("items");
    	//frm.refresh();
  //msgprint(d.expense_account);
});

Is there any log on browser console?

@saurabh6790 no, it’s clear with no error… If I msgprint expense account it shows desired value, but it gets overridden by stock adjustment account

Looks like a bug to me. The script looks like it should work. I suggest making a GitHub issue for it.

(If you do, link to it in this thread)

@saurabh6790 Is it a bug? before v7.1 update this script did work fine…no error on console

https://github.com/frappe/erpnext/issues/7148