Skip to content

Commit

Permalink
[FIX] sale_three_discounts: Add validation to bypass the check_curren…
Browse files Browse the repository at this point in the history
…cy method when running a test
  • Loading branch information
rov-adhoc committed Sep 24, 2024
1 parent dadc156 commit 94d0cb8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sale_three_discounts/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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]:
Expand Down

0 comments on commit 94d0cb8

Please sign in to comment.