summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Smet <las@odoo.com>2021-01-05 13:18:47 +0000
committerLaurent Smet <las@odoo.com>2021-01-05 13:18:47 +0000
commita23a47457d98aba4ec643f4422f3735d98fab2b4 (patch)
treed24766c5283456538f9371e387552b1f8e64b76f
parent8d34e1606f930deaa148563ffd40c69457650305 (diff)
[FIX] account: Fix 'change_account' automatic entry wizard
Percentage is not used when change_account is selected. Then, the constraint must not be triggered in that case. closes odoo/odoo#64083 Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
-rw-r--r--addons/account/wizard/account_automatic_entry_wizard.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/wizard/account_automatic_entry_wizard.py b/addons/account/wizard/account_automatic_entry_wizard.py
index 7d021a30f0b..9187f0a8e0c 100644
--- a/addons/account/wizard/account_automatic_entry_wizard.py
+++ b/addons/account/wizard/account_automatic_entry_wizard.py
@@ -47,7 +47,7 @@ class AutomaticEntryWizard(models.TransientModel):
@api.constrains('percentage', 'action')
def _constraint_percentage(self):
for record in self:
- if not (0.0 < record.percentage <= 100.0):
+ if not (0.0 < record.percentage <= 100.0) and record.action == 'change_period':
raise UserError(_("Percentage must be between 0 and 100"))
if record.percentage != 100 and record.action != 'change_period':
raise UserError(_("Percentage can only be set for Change Period method"))