Sales Invoice item table amount

Hi,all I am try an item which has default UOM in bags as it selling in bags and i set the conversion with kg i.e 1bags=25 kg…in Sales Invoice item table i take bags quantity with kg rate
and changed the conversion from bags to kg so its conversion factor calculates its quantity i.e
bags *kg(25)
But the the amount is not getting changed acoording to that conversed quantity.
need help with custom script i tried this.

frappe.ui.form.on(“Sales Invoice”,“validate”, function(frm,cdt,cdn){
conversion_factor: function(frm,cdt,cdn){
d = locals[cdt][cdn]
amount = d.qty * d.conversion_factor*d.rate
frappe.model.set_value(cdt, cdn, “amount”,amount);
}

});

Try the following:

Option 1:

  1. Set the selling rate as per default UOM , ie, bags.
  2. Toggle the option Price Not UOM Dependant under Price List:
    Price Lists
  3. Go back to the invoice, reselect the price list and item and check.

Option 2:
Create an item price for UOM = kg in the system.

Also, validate function will be triggered on document save. Have you tried saving the document?

https://frappeframework.com/docs/user/en/api/form#frmsave

@kennethsequeira can we trigger amount=qty x conversion_factor x rate?? with custom script