[FIX] condominium: prevent error when opening form view of motion#1828
Closed
fw-bot wants to merge 1 commit intoodoo:saas-19.1from
Closed
Conversation
When a user opens the form view of a motion, a traceback will appear. Steps to reproduce the error: - Install the "condominium" module - Go to Calendar > Create a new meeting > Set Condominium > In the Motions Tab, Set a Voting key and Motion > Save - Click on the View button of the motion Traceback: "ZeroDivisionError: float division by zero" https://github.com/odoo/industry/blob/5af6517539f2929b0f1549c05f58babf60fb4450/condominium/data/ir_model_fields.xml#L876-L877 The error occurs because the computation divides by: "sum([x_ratio.x_ratio for x_ratio in event.x_voting_key_id.x_ratio_ids])" This value can become 0 when: - There are no "x_ratio_ids", or - The sum of "x_ratio values" equals 0 As a result, the division raises a ZeroDivisionError when opening the motion form view. sentry-7317501911 X-original-commit: 2b9e5b1
Collaborator
Author
|
This PR targets saas-19.1 and is part of the forward-port chain. Further PRs will be created up to master. More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
robodoo
pushed a commit
that referenced
this pull request
Mar 10, 2026
When a user opens the form view of a motion, a traceback will appear. Steps to reproduce the error: - Install the "condominium" module - Go to Calendar > Create a new meeting > Set Condominium > In the Motions Tab, Set a Voting key and Motion > Save - Click on the View button of the motion Traceback: "ZeroDivisionError: float division by zero" https://github.com/odoo/industry/blob/5af6517539f2929b0f1549c05f58babf60fb4450/condominium/data/ir_model_fields.xml#L876-L877 The error occurs because the computation divides by: "sum([x_ratio.x_ratio for x_ratio in event.x_voting_key_id.x_ratio_ids])" This value can become 0 when: - There are no "x_ratio_ids", or - The sum of "x_ratio values" equals 0 As a result, the division raises a ZeroDivisionError when opening the motion form view. sentry-7317501911 closes #1828 X-original-commit: 2b9e5b1 Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
robodoo
pushed a commit
that referenced
this pull request
Mar 10, 2026
When a user opens the form view of a motion, a traceback will appear. Steps to reproduce the error: - Install the "condominium" module - Go to Calendar > Create a new meeting > Set Condominium > In the Motions Tab, Set a Voting key and Motion > Save - Click on the View button of the motion Traceback: "ZeroDivisionError: float division by zero" https://github.com/odoo/industry/blob/5af6517539f2929b0f1549c05f58babf60fb4450/condominium/data/ir_model_fields.xml#L876-L877 The error occurs because the computation divides by: "sum([x_ratio.x_ratio for x_ratio in event.x_voting_key_id.x_ratio_ids])" This value can become 0 when: - There are no "x_ratio_ids", or - The sum of "x_ratio values" equals 0 As a result, the division raises a ZeroDivisionError when opening the motion form view. sentry-7317501911 closes #1828 X-original-commit: 2b9e5b1 Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

When a user opens the form view of a motion, a traceback will appear.
Steps to reproduce the error:
condominiummoduleIn the Motions Tab, Set a Voting key and Motion > Save
Traceback:
industry/condominium/data/ir_model_fields.xml
Lines 876 to 877 in 5af6517
sum([x_ratio.x_ratio for x_ratio in event.x_voting_key_id.x_ratio_ids])This value can become 0 when:
x_ratio_ids, orx_ratio valuesequals 0As a result, the division raises a ZeroDivisionError when opening the motion form view.
sentry-7317501911
Forward-Port-Of: #1822