• ¡Welcome to Square Theme!
  • This news are in header template.
  • Please ignore this message.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Random numbers in Basic Rate
#1
I am encountering an impossible bug.

I have created a Server Script to handle Before Submit of a Delivery Note.
The required functionality is record a special Material Transfer type Stock Entry

Today for the first time after more than 1500 executions, over the last two months, the script suddenly failed with the error …

""frappe.exceptions.Update After Submit Error:
____ Not allowed to change Basic Rate (as per Stock UOM) after submission"

… as you can see here below:

Code:
:       :       :       :       :       :
File "apps/frappe/frappe/model/document.py", line 868, in validate_update_after_submit
  d._validate_update_after_submit()
File "apps/frappe/frappe/model/base_document.py", line 857, in _validate_update_after_submit
  frappe.throw(
File "apps/frappe/frappe/__init__.py", line 504, in throw
  msgprint(
File "apps/frappe/frappe/__init__.py", line 479, in msgprint
  _raise_exception()
File "apps/frappe/frappe/__init__.py", line 434, in _raise_exception
  raise raise_exception(msg)
frappe.exceptions.UpdateAfterSubmitError:
   Not allowed to change Basic Rate (as per Stock UOM) after submission

After poking around for hours I edited the Frappe source code to add print statement line
Code:
print(f"df.label: {df.label} || self_value: ({self_value})  versus  db_value: ({db_value})")
… just before the thrown exception, like this …

File : frappe/frappe/model/base_document.py

My Date and Number Format settings specify Float = 9, but evidently the random number generated can be Float = 12 and causes this first “collision” after >1500 executions.

Even more annoying … it is not random!!! because I get the value 0.004792216125 every single time.
Questions:

    From where does Basic Rate (as per Stock UOM) get its value?
    How can I force a value of zero?
    Why do I get an “after submission” fault, if I am inserting a new record?
 
Reply
  


Messages In This Thread
Random numbers in Basic Rate - by abdullahiyu - 05-24-2024, 05:38 PM
RE: Random numbers in Basic Rate - by Nicostly - 05-24-2024, 06:08 PM

Forum Jump:


Browsing: 1 Guest(s)