-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intermittent RelatedObjectDoesNotExist
Error in Computed Fields
#156
Comments
At a first glance - yes this looks like an issue with the mro. Can you re-check, whether for a successful run the mro looks the same? To further debug things - can you show, what the admin gives for that model under "Computedfields" >> "Computed Fields Models" >> your_model including its ModelGraph? (You can switch on the admin helper views in your settings.py by defining |
In a successful run, the MRO is different — the currency_id appears before price_total, preventing the issue from occurring. I noticed that the MRO displayed in the admin panel changes every time I restart the server. This seems odd to me because, as far as I understand, the MRO should only change if there's a modification to the database model or the class hierarchy. Could you confirm if my understanding is correct, or is there another reason why the MRO would behave this way? |
Eww thats a serious bug - yepp, the mro must be stable for a certain dependency configuration, it may never flip positions. |
Yes, this is a critical bug, and I hope it can be resolved as soon as possible since I have a project similar to Odoo that relies on it. I will also continue to investigate the issue further, and if I discover anything useful, I will share it with you promptly. |
Issue Overview
I am encountering an intermittent
RelatedObjectDoesNotExist
error inside one of my computed functions that depends on another computed field. The error occurs sporadically and can be temporarily resolved by restarting the server.Here is an example of the problematic code:
Error Details
The error looks like this:
Here is the definition of the currency computed field that seems to cause the issue:
Observations
This issue only happens sometimes and can be resolved by stopping and restarting the server.
Debugging indicates that the cf_mro (computed fields method resolution order) appears incorrect at times. Below is the relevant portion of the code for debugging:
Key Questions
Expected Behavior
Steps to Reproduce
Additional Notes
The issue seems related to how the computed fields dependencies are resolved (cf_mro).
Any insight into why cf_mro is inconsistent or incorrect would be greatly appreciated.
The text was updated successfully, but these errors were encountered: