![]() |
Random numbers in Basic Rate - Printable Version +- Darkky Minecraft Server Forum (https://darkkyshadow.com/forum/secret) +-- Forum: Player Section (https://darkkyshadow.com/forum/secret/forumdisplay.php?fid=3) +--- Forum: Others (https://darkkyshadow.com/forum/secret/forumdisplay.php?fid=9) +--- Thread: Random numbers in Basic Rate (/showthread.php?tid=7515) |
Random numbers in Basic Rate - abdullahiyu - 05-24-2024 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: : : : : : : 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})") 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? RE: Random numbers in Basic Rate - Nicostly - 05-24-2024 It's odd how it keeps generating the same random value every time. Have you tried exploring your system settings to trace where that value might be coming from?And that "after submission" fault you're encountering—even with new records—is definitely unexpected. It might be worth revisiting any validation rules or restrictions in your system to see what's causing it.Your workaround with setting 'docstatus': 0 seems to provide a temporary fix, but it's important to unravel the underlying issue. But if you're ever stuck, you can always use a d20 roller to shake things up and approach the problem from a different angle. |