Issue with Custom Script for List View

I am using a custom script which is perfectly working on Purchase Order form where I can see 5 columns in the grid whereas the same code is not working on the Sales Order form.

frappe.ui.form.on("Sales Order", "onload", function(frm, doctype, name)

frm.get_field('items').grid.editable_fields = [
			{fieldname: 'item_code', columns: 2},
			{fieldname: 'item_name', columns: 2},
			{fieldname: 'qty', columns: 2},
                        {fieldname: 'customized', columns: 2},
			{fieldname: 'rate', columns: 2}
frappe.form.link_formatters['Item'] = function(value, doc) {
		return value + ': ' + doc.item_name;

Purchase Order Doctype:

Sales Order Doctype:

Does, anybody have any idea about this?

Ruchin Sharma

Can you check in the Sales Order Item table, what is the value of Columns field for Item Code, by default it is 4 I think and for others as well.

And also you don’t need to set the columns via script anymore, you can mention columns in Columns field.

Thanks it worked for me.

Ruchin Sharma