How can I refresh Quotation within child table form script?

I have added a few fields to the Quotation Item fields and these fields change the rate and the line total. At the moment, the Line Total gets refreshed correctly, but the quotation total doesnt get updated. How can I call the parent (Quotation) form to be refreshed?

Just add a line in custom file to save/update the doc. It will propagate parent values.

Hi @avaiskhatri. Thanks for the quick reply. Can you just show me a snippet/example?

This is what I currently have:

frappe.ui.form.on("Quotation Item", "labour", function(frm, doctype, name) {
  let row = locals[doctype][name];
  
  let rate = row.labour + row.trim + row.paint + row.spares;
  row.rate = rate;
  refresh_field("items");
});

frappe.ui.form.on("Quotation Item", "labour", function(frm, doctype, name) {
  let row = locals[doctype][name];
  
  let rate = row.labour + row.trim + row.paint + row.spares;
  row.rate = rate;
  refresh_field("items");

//save the doc
frm.save();
});

wont this save to the DB?

Save and submit both has impact on db.

Since saving the document will make the doc status to draft and submit will set the status to Publish.

Oh. I think maybe you didn’t quite understand what I’m trying to do. Here is my case:

When creating a quotation, by default, when you add an item to the items table, the totals update, without saving it to the database. This is what I want, to have the totals, and everything thats affected by each item’s line_total/(rate*amount) to be refreshed and show updated totals.

I’ve gotten here because I added a couple more fields to the Quotation Item doctype, which affect the rate.

So, currently, as I have mentioned in the original post, the rate does update correctly in the item row, as well as the amount. Now my problem is on updating the Quotation totals(globally).