"exception": "AttributeError: 'Document' object has no attribute 'set_status'"

App Versions

{
	"custom_apaulsoft": "0.0.1",
	"erpnext": "13.49.5",
	"frappe": "13.51.1"
}

Route

Form/Purchase Order/PODM-23-24-01625

Trackeback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 66, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 38, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 76, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1473, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/form/save.py", line 22, in savedocs
    doc.submit()
  File "apps/frappe/frappe/model/document.py", line 1020, in submit
    return self._submit()
  File "apps/frappe/frappe/model/document.py", line 1009, in _submit
    return self.save()
  File "apps/frappe/frappe/model/document.py", line 312, in save
    return self._save(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 366, in _save
    self.run_post_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1090, in run_post_save_methods
    self.run_method("on_submit")
  File "apps/frappe/frappe/model/document.py", line 943, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1264, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1246, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 940, in fn
    return method_object(*args, **kwargs)
  File "apps/erpnext/erpnext/buying/doctype/purchase_order/purchase_order.py", line 309, in on_submit
    self.update_prevdoc_status()
  File "apps/erpnext/erpnext/controllers/status_updater.py", line 168, in update_prevdoc_status
    self.update_qty()
  File "apps/erpnext/erpnext/controllers/status_updater.py", line 367, in update_qty
    self._update_percent_field_in_targets(args, update_modified)
  File "apps/erpnext/erpnext/controllers/status_updater.py", line 439, in _update_percent_field_in_targets
    self._update_percent_field(args, update_modified)
  File "apps/erpnext/erpnext/controllers/status_updater.py", line 472, in _update_percent_field
    target.set_status(update=True)
AttributeError: 'Document' object has no attribute 'set_status'

Request Data

{
	"type": "POST",
	"args": {
		"doc": "{\"name\":\"PODM-23-24-01672\",\"owner\":\"Administrator\",\"creation\":\"2023-11-28 18:04:28.101294\",\"modified\":\"2023-11-28 18:04:28.101294\",\"modified_by\":\"Administrator\",\"idx\":0,\"docstatus\":0,\"title\":\"{supplier_name}\",\"naming_series\":\"PODM-.FY.-\",\"supplier\":\"COSMIC DEVISES\",\"po_type\":\"Domestic\",\"supplier_name\":\"COSMIC DEVISES\",\"apply_tds\":0,\"company\":\"A.Paul Software Systems Pvt Ltd\",\"transaction_date\":\"2023-11-25\",\"schedule_date\":\"2023-11-28\",\"supplier_address\":\"COSMIC DEVICES 1702/307-Billing\",\"supplier_gstin\":\"07AKYPM5805H1ZN\",\"address_display\":\"1702/307 Shrinath Building  Bhagirath Palace  Chandni Chowk. <br>New Delhi <br>Delhi<br>\\nDelhi, State Code: 07<br>Postal Code: 110006<br>India<br>\\nGSTIN: 07AKYPM5805H1ZN<br>\",\"shipping_address\":\"A.Paul Software Systems Pvt Ltd-Shipping\",\"place_of_supply\":\"06-Haryana\",\"shipping_address_display\":\"Plot No. 766, Sector-69<br>Imt Faridabad<br>Faridabad<br>\\nHaryana, State Code: 06<br>Postal Code: 121004<br>India<br>\\nPhone: 123456789<br>Email: Am@gmail.com<br>GSTIN: 06AAQCA8680D1ZE<br>\",\"company_gstin\":\"06AAQCA8680D1ZE\",\"billing_address\":\"A.Paul Software Systems Pvt Ltd-Shipping\",\"billing_address_display\":\"Plot No. 766, Sector-69<br>Imt Faridabad<br>Faridabad<br>\\nHaryana, State Code: 06<br>Postal Code: 121004<br>India<br>\\nPhone: 123456789<br>Email: Am@gmail.com<br>GSTIN: 06AAQCA8680D1ZE<br>\",\"currency\":\"INR\",\"conversion_rate\":1,\"buying_price_list\":\"Standard Buying\",\"price_list_currency\":\"INR\",\"plc_conversion_rate\":1,\"ignore_pricing_rule\":0,\"is_subcontracted\":\"No\",\"total_qty\":4,\"base_total\":960,\"base_net_total\":960,\"total_no_of_pins\":0,\"total_net_weight\":0,\"total\":960,\"net_total\":960,\"rate_per_pin\":0,\"tax_category\":\"Out-State\",\"taxes_and_charges\":\"Input GST Out-State - APSSPL\",\"other_charges_calculation\":\"<div class=\\\"tax-break-up\\\" style=\\\"overflow-x: auto;\\\">\\n\\t<table class=\\\"table table-bordered table-hover\\\">\\n\\t\\t<thead>\\n\\t\\t\\t<tr>\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t<th class=\\\"text-left\\\">HSN/SAC</th>\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t<th class=\\\"text-right\\\">Taxable Amount</th>\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t<th class=\\\"text-right\\\">Input Tax IGST</th>\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\t</tr>\\n\\t\\t</thead>\\n\\t\\t<tbody>\\n\\t\\t\\t\\n\\t\\t\\t\\t<tr>\\n\\t\\t\\t\\t\\t<td>8523</td>\\n\\t\\t\\t\\t\\t<td class=\\\"text-right\\\">\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\tINR 960.00\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t</td>\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t<td class=\\\"text-right\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t(18.0%)\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tINR 172.80\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t</td>\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t</tr>\\n\\t\\t\\t\\n\\t\\t\\t\\t<tr>\\n\\t\\t\\t\\t\\t<td>8536</td>\\n\\t\\t\\t\\t\\t<td class=\\\"text-right\\\">\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\tINR 0.00\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t</td>\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t<td class=\\\"text-right\\\">\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t(18.0%)\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t\\t\\tINR 0.00\\n\\t\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\t</td>\\n\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t</tr>\\n\\t\\t\\t\\n\\t\\t</tbody>\\n\\t</table>\\n</div>\",\"base_taxes_and_charges_added\":172.8,\"base_taxes_and_charges_deducted\":0,\"base_total_taxes_and_charges\":172.8,\"taxes_and_charges_added\":172.8,\"taxes_and_charges_deducted\":0,\"total_taxes_and_charges\":172.8,\"apply_discount_on\":\"Grand Total\",\"base_discount_amount\":0,\"additional_discount_percentage\":0,\"discount_amount\":0,\"base_grand_total\":1132.8,\"base_rounding_adjustment\":0.2,\"base_in_words\":\"INR One Thousand, One Hundred And Thirty Three only.\",\"base_rounded_total\":1133,\"grand_total\":1132.8,\"rounding_adjustment\":0.2,\"rounded_total\":1133,\"disable_rounded_total\":0,\"in_words\":\"INR One Thousand, One Hundred And Thirty Three only.\",\"advance_paid\":0,\"status\":\"Draft\",\"per_billed\":0,\"per_received\":0,\"tc_name\":\"Purchase Order Standard Terms\",\"terms\":\"<div class=\\\"ql-editor read-mode\\\"><p><strong>Note: </strong></p><ul><li data-list=\\\"bullet\\\"><span class=\\\"ql-ui\\\" contenteditable=\\\"false\\\"></span>Please mention our <strong>P.O. Number</strong> in your challan/invoice</li><li data-list=\\\"bullet\\\"><span class=\\\"ql-ui\\\" contenteditable=\\\"false\\\"></span><strong style=\\\"color: rgb(230, 0, 0);\\\">Please share the test report with the material. Without test report, we will not accept any materials.</strong></li><li data-list=\\\"bullet\\\"><span class=\\\"ql-ui\\\" contenteditable=\\\"false\\\"></span>Any material over &amp; above (max. up to tolerance %) from P.O. Qty shall be rejected /consumed at supplier's cost.</li><li data-list=\\\"bullet\\\"><span class=\\\"ql-ui\\\" contenteditable=\\\"false\\\"></span>If required material will not meet the requirements as specified /required or processability.</li><li data-list=\\\"bullet\\\"><span class=\\\"ql-ui\\\" contenteditable=\\\"false\\\"></span>You have to replace the material without any cost implication.</li></ul><p><br></p><p><br></p><p><br></p><p><strong style=\\\"background-color: rgb(255, 255, 255); color: black;\\\"><u>Important</u></strong><span style=\\\"background-color: rgb(255, 255, 255); color: black;\\\">: </span></p><ul><li data-list=\\\"bullet\\\"><span class=\\\"ql-ui\\\" contenteditable=\\\"false\\\"></span><span style=\\\"background-color: rgb(255, 255, 255); color: black;\\\">All terms mentioned in the PO in Pdf format , are final.</span></li><li data-list=\\\"bullet\\\"><span class=\\\"ql-ui\\\" contenteditable=\\\"false\\\"></span><span style=\\\"background-color: rgb(255, 255, 255); color: black;\\\">No amendment/ modification to the terms through any communication/ email etc Shall be legally binding, unless an Amended PO in the&nbsp;same format is issued.</span></li><li data-list=\\\"bullet\\\"><span class=\\\"ql-ui\\\" contenteditable=\\\"false\\\"></span><span style=\\\"background-color: rgb(255, 255, 255); color: black;\\\">It shall be obligatory on the vendor to receive an amended PO in this same pdf format </span></li><li data-list=\\\"bullet\\\"><span class=\\\"ql-ui\\\" contenteditable=\\\"false\\\"></span><span style=\\\"background-color: rgb(255, 255, 255); color: black;\\\">before considering any amendment to the contract terms.</span></li><li data-list=\\\"bullet\\\"><span class=\\\"ql-ui\\\" contenteditable=\\\"false\\\"></span><span style=\\\"background-color: rgb(255, 255, 255); color: black;\\\">Delivery terms are sacrosanct.</span></li><li data-list=\\\"bullet\\\"><span class=\\\"ql-ui\\\" contenteditable=\\\"false\\\"></span><span style=\\\"background-color: rgb(255, 255, 255); color: black;\\\">Failure to meet delivery dates and schedules mention in the PO shall make the contract </span></li><li data-list=\\\"bullet\\\"><span class=\\\"ql-ui\\\" contenteditable=\\\"false\\\"></span><span style=\\\"background-color: rgb(255, 255, 255); color: black;\\\">voidable at the option of the purchaser.</span></li><li data-list=\\\"bullet\\\"><span class=\\\"ql-ui\\\" contenteditable=\\\"false\\\"></span><span style=\\\"background-color: rgb(255, 255, 255); color: black;\\\">All disputes shall be subject to Delhi Jurisdiction.</span></li></ul></div>\",\"letter_head\":\"Apaul Software Systems Pvt Ltd\",\"language\":\"en-US\",\"group_same_items\":0,\"party_account_currency\":\"INR\",\"is_internal_supplier\":0,\"represents_company\":\"\",\"doctype\":\"Purchase Order\",\"items\":[{\"name\":\"2e063b36b8\",\"owner\":\"Administrator\",\"creation\":\"2023-11-28 18:04:28.101294\",\"modified\":\"2023-11-28 18:04:28.101294\",\"modified_by\":\"Administrator\",\"parent\":\"PODM-23-24-01672\",\"parentfield\":\"items\",\"parenttype\":\"Purchase Order\",\"idx\":1,\"docstatus\":0,\"item_code\":\"OGXXUSBHUBXXXXX1\",\"item_name\":\"USB Hub with SD/Micro SD Card Reader\",\"schedule_date\":\"2023-11-28\",\"description\":\"USB Hub with SD/Micro SD Card Reader\",\"gst_hsn_code\":\"8523\",\"is_nil_exempt\":0,\"is_non_gst\":0,\"image\":\"\",\"qty\":3,\"stock_uom\":\"Nos\",\"uom\":\"Nos\",\"conversion_factor\":1,\"stock_qty\":3,\"price_list_rate\":320,\"last_purchase_rate\":320,\"base_price_list_rate\":320,\"margin_type\":\"\",\"margin_rate_or_amount\":0,\"rate_with_margin\":0,\"discount_percentage\":0,\"discount_amount\":0,\"base_rate_with_margin\":0,\"rate\":320,\"amount\":960,\"update_lpr\":0,\"item_tax_template\":\"Pur-18% Out-State - APSSPL\",\"base_rate\":320,\"base_amount\":960,\"stock_uom_rate\":320,\"is_free_item\":0,\"net_rate\":320,\"net_amount\":960,\"base_net_rate\":320,\"base_net_amount\":960,\"warehouse\":\"Stores - APSSPL\",\"actual_qty\":4,\"company_total_stock\":5,\"material_request\":\"MRPU-23-24-01148\",\"material_request_item\":\"1818cb3ed7\",\"delivered_by_supplier\":0,\"against_blanket_order\":0,\"blanket_order_rate\":0,\"item_group\":\"Tools\",\"received_qty\":0,\"returned_qty\":0,\"billed_amt\":0,\"expense_account\":\"Cost of Goods Sold - APSSPL\",\"include_exploded_items\":0,\"weight_per_unit\":0,\"total_weight\":0,\"cost_center\":\"Main - APSSPL\",\"is_fixed_asset\":0,\"item_tax_rate\":\"{\\\"Input Tax IGST - APSSPL\\\": 18.0}\",\"page_break\":0,\"doctype\":\"Purchase Order Item\"},{\"name\":\"210458922d\",\"owner\":\"Administrator\",\"creation\":\"2023-11-28 18:04:28.101294\",\"modified\":\"2023-11-28 18:04:28.101294\",\"modified_by\":\"Administrator\",\"parent\":\"PODM-23-24-01672\",\"parentfield\":\"items\",\"parenttype\":\"Purchase Order\",\"idx\":2,\"docstatus\":0,\"item_code\":\"ONGGS108LPXXXXXA\",\"item_name\":\"8-Port GIGABIT Ethernet Switch\",\"schedule_date\":\"2023-11-28\",\"description\":\"<div><p>NETGEAR 8-Port Gigabit Ethernet Unmanaged PoE Switch (GS108LP) - with 8 x PoE+ @ 60W Upgradeable, Desktop/Rackmount, and ProSAFE Limited Lifetime Protection</p></div>\",\"gst_hsn_code\":\"8536\",\"is_nil_exempt\":0,\"is_non_gst\":0,\"image\":\"/files/GS108LP ETH SWITCH (8-PORT).jpg\",\"qty\":1,\"stock_uom\":\"Nos\",\"uom\":\"Nos\",\"conversion_factor\":1,\"stock_qty\":1,\"price_list_rate\":0,\"last_purchase_rate\":0,\"base_price_list_rate\":0,\"margin_type\":\"\",\"margin_rate_or_amount\":0,\"rate_with_margin\":0,\"discount_percentage\":0,\"discount_amount\":0,\"base_rate_with_margin\":0,\"rate\":0,\"amount\":0,\"update_lpr\":0,\"item_tax_template\":\"Pur-18% Out-State - APSSPL\",\"base_rate\":0,\"base_amount\":0,\"stock_uom_rate\":0,\"is_free_item\":0,\"net_rate\":0,\"net_amount\":0,\"base_net_rate\":0,\"base_net_amount\":0,\"warehouse\":\"Stores - APSSPL\",\"actual_qty\":0,\"company_total_stock\":0,\"material_request\":\"MRPU-23-24-01148\",\"material_request_item\":\"6193093fdd\",\"delivered_by_supplier\":0,\"against_blanket_order\":0,\"blanket_order_rate\":0,\"item_group\":\"Component\",\"received_qty\":0,\"returned_qty\":0,\"billed_amt\":0,\"expense_account\":\"Cost of Goods Sold - APSSPL\",\"include_exploded_items\":0,\"weight_per_unit\":0,\"total_weight\":0,\"cost_center\":\"Main - APSSPL\",\"is_fixed_asset\":0,\"item_tax_rate\":\"{\\\"Input Tax IGST - APSSPL\\\": 18.0}\",\"page_break\":0,\"doctype\":\"Purchase Order Item\"}],\"pricing_rules\":[],\"supplied_items\":[],\"taxes\":[{\"name\":\"7f7acc94d2\",\"owner\":\"Administrator\",\"creation\":\"2023-11-28 18:04:28.101294\",\"modified\":\"2023-11-28 18:04:28.101294\",\"modified_by\":\"Administrator\",\"parent\":\"PODM-23-24-01672\",\"parentfield\":\"taxes\",\"parenttype\":\"Purchase Order\",\"idx\":1,\"docstatus\":0,\"category\":\"Total\",\"add_deduct_tax\":\"Add\",\"charge_type\":\"On Net Total\",\"included_in_print_rate\":0,\"included_in_paid_amount\":0,\"account_head\":\"Input Tax IGST - APSSPL\",\"description\":\"Input Tax IGST\",\"rate\":28,\"cost_center\":\"Main - APSSPL\",\"account_currency\":\"INR\",\"tax_amount\":172.8,\"tax_amount_after_discount_amount\":172.8,\"total\":1132.8,\"base_tax_amount\":172.8,\"base_total\":1132.8,\"base_tax_amount_after_discount_amount\":172.8,\"item_wise_tax_detail\":\"{\\\"OGXXUSBHUBXXXXX1\\\":[18.0,172.79999999999998],\\\"ONGGS108LPXXXXXA\\\":[18.0,0.0]}\",\"doctype\":\"Purchase Taxes and Charges\"}],\"payment_schedule\":[{\"name\":\"7a7a3febb9\",\"creation\":\"2023-11-28 18:04:28.388769\",\"modified\":\"2023-11-28 18:04:28.388769\",\"modified_by\":\"Administrator\",\"parent\":\"PODM-23-24-01672\",\"parentfield\":\"payment_schedule\",\"parenttype\":\"Purchase Order\",\"idx\":1,\"docstatus\":0,\"due_date\":\"2023-11-25\",\"invoice_portion\":100,\"discount\":0,\"payment_amount\":1133,\"outstanding\":1133,\"paid_amount\":0,\"discounted_amount\":0,\"base_payment_amount\":1133,\"doctype\":\"Payment Schedule\"}],\"delivery_schedule\":[],\"__onload\":{\"supplier_tds\":null}}",
		"action": "Submit"
	},
	"btn": {
		"jQuery2240473884847255736431": {
			"events": {
				"click": [
					{
						"type": "click",
						"origType": "click",
						"guid": 11509,
						"namespace": ""
					}
				]
			}
		}
	},
	"freeze": true,
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.desk.form.save.savedocs"
}

Response Data

{
	"exception": "AttributeError: 'Document' object has no attribute 'set_status'"
}