Can we call Python function from listview.js file?

On our custom application we have a kind of item doctype, and we want to set indicator on listview file dynamically. If the item is in sales order then we want “In order” indicator and if the item is sold (Exist in sales invoice) then we want “Sold” indicator in list view file.
Basically we want to verify the link doctype and set the indicator by calling a python function.
Is it possible to call a python function from listview.js file? if not then what is the best idea to implement this features.

Kindly suggest, Thank you.

If you whitelist a python function you should be able to call it from JS file

You can add the custom status field on Item and use hooks on Sales Order, Sales Invoice you can update the item’s status field to In Order or Sold.

Then using item_list.js you can set the indicator according to custom status field’s value.

Thanks,
Makarand

1 Like

Thank you @makarand_b