Skip to content
Snippets Groups Projects
Commit afbd59e5 authored by Mohit Beniwal's avatar Mohit Beniwal
Browse files

[FIX] uom: prevent set value of ratio as zero in uom


ZeroDivsionError: float division to Zero is generated because for assigning
value to 'factor' of uom in method '_set_ratio', it tries to divide value by
Zero for uom_type 'Bigger'.

Steps to reproduce:
1) Install 'Inventory' module.
2) Click on 'Configuration' > 'Settings'.
3) Activate 'Units of Measure' > click on 'Units of Measure' button under it.
4) Click on 'Create' button to create new uom category.
5) Give any name > in 'Units of Measure' page, click on 'Add a line'.
6) Enter name and select type as 'Reference unit of measure for this category'.
7) Now, add another line and select type as 'Bigger than the the Reference unit
   of measure' and set the 'ratio' value to Zero, Error will be generated.

By applying this,it will check for the value of 'ratio' to prevent division by 0

sentry - 4174584503

closes odoo/odoo#121409

Signed-off-by: default avatarWilliam Henrotin (whe) <whe@odoo.com>
parent 479a3354
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment