Not allowed to change Amount after submission

I have a Custom field (Select field with certain set of Statuses) on PO for tracking Progress of PO, which is allowed to change after submit.

PO value is 2451.60 (3qty*817.20) when I try to change the Status after submission, I get an error saying “Not allowed to change Amount after submission”

My guess on what is happening here

  1. When I try to update the status, the system calculate the Amount again (on update), this value comes out to be 817.20*3=2451.6
  2. Since this value (2451.6) is not equal to the value in DB (2451.60), the system tries to replace it which is leading to this error [The calculated amount has only 1 decimal point as the 0 after decimal is not considered after calculation, where as the value in db has two decimal points]

I verified this theory by changing the rate on a duplicated PO to 817.21, therefore the amount is 2451.63. When I try to change the value in custom status field on this PO, there is no error.

Has anyone else faced this error before? How did you handle this?


Full traceback for reference

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 60, in application
    response = frappe.api.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 55, in handle
    return frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 22, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 61, in execute_cmd
    return, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 1042, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/", line 19, in savedocs
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 859, in submit
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 848, in _submit
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 272, in save
    return self._save(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 314, in _save
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 716, in validate_update_after_submit
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/", line 621, in _validate_update_after_submit
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 364, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red')
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 350, in msgprint
  File "/home/frappe/frappe-bench/apps/frappe/frappe/", line 316, in _raise_exception
    raise raise_exception(msg)
frappe.exceptions.UpdateAfterSubmitError: Not allowed to change Amount after submission

Number format in System settings and Currency is #,###.##
Float Precision and Currency Precision in System settings is unset
Precision via Customize form is unset