Save or update Project status after frappe.client.set_value

Hi All,
Our Company need some Pre-Sale actions like, taking survey, proposal drawing, price analysis. i make a script to create project against opportunity and add Tasks against it with frappe.db.insert. everything work as expected.

But i would like to add a Cancel button in any case of created with wrong template or that opportunity is cancelled. i manage to make Tasks are cancelled state with frappe.client.set_value but project field percent_complete is not show right value after cancel. When i open project and save it its show normal values.

I know Task is pushing status via save, and Project pull Tasks status via save and i added directly on database. I have been checked github and Whitelisted endpoints, project updates endpoints in and aren’t whitelisted. Is there any way to call them or is there any way to save project doc after frappe.client.set_value?

one of my task cancel call

cur_frm.cscript.cancel = function(frm, cdt, cdn){
var d = locals[cdt][cdn];{
  method: 'frappe.client.get_value',
  args: {
    doctype: 'Task',
    filters: {
      'project': d.project,
      'subject': 'Survey',
    fieldname: ['name', 'status']
  }, callback: function (data) {
    if (data.message.status = 'Open' || data.message.status = 'Overdue'){
        method: 'frappe.client.set_value',
        'args': {
          'doctype': 'Task',
          fieldname: {
            'status': 'Cancelled',

Solved! i have to make re-assign percent_complete_method to Task Completion on all Open projects my code is below

cur_frm.cscript.update_projects = function(frm, cdt, cdn){
  var d = locals[cdt][cdn];{ method: 'frappe.desk.doctype.bulk_update.bulk_update.update',
  args: {
    doctype: 'Project',
    field: 'percent_complete_method',
    value: 'Task Completion',
    condition: "status='Open'",