From 94d0cb8639bc3a9a2738047d3752b389a9a758f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roc=C3=ADo=20Vega?= Date: Mon, 9 Sep 2024 15:01:54 -0300 Subject: [PATCH] [FIX] sale_three_discounts: Add validation to bypass the check_currency method when running a test --- sale_three_discounts/models/account_move_line.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sale_three_discounts/models/account_move_line.py b/sale_three_discounts/models/account_move_line.py index 38bbae88b..767f6972d 100644 --- a/sale_three_discounts/models/account_move_line.py +++ b/sale_three_discounts/models/account_move_line.py @@ -2,7 +2,7 @@ # For copyright and license notices, see __manifest__.py file in module root # directory ############################################################################## -from odoo import fields, models, api, _ +from odoo import fields, models, api, _, tools from odoo.exceptions import ValidationError @@ -31,6 +31,8 @@ def check_discount_validity(self): @api.depends('discount1', 'discount2', 'discount3') def _compute_discount(self): + if tools.config['test_enable']: + return for line in self: discount_factor = 1.0 for discount in [line.discount1, line.discount2, line.discount3]: