Skip to content
Snippets Groups Projects
Commit 8489da59 authored by Agustín Castro Bugallo's avatar Agustín Castro Bugallo
Browse files

[FIX] account: add default return for `_compute_amount`


The function `_compute_amount` on `account.tax` returns None if the value of
`amount_type` is not a standard Odoo value. During normal use, this will never
be the case, and if the value is  modified by a custom module the method is
overriden in its code to account for that case.

During an upgrade, however, custom modules are not available. During the tests,
if a field needs to be computed using that function, it will break with
`TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'`

Adding a default return to the function in case the `amount_type` is not
recognisef will help prevent this.

closes odoo/odoo#84367

Signed-off-by: default avatarOlivier Colson <oco@odoo.com>
parent 309baeb2
Branches
Tags
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment