diff options
| author | Laurent Smet <las@odoo.com> | 2021-01-05 13:18:47 +0000 |
|---|---|---|
| committer | Laurent Smet <las@odoo.com> | 2021-01-05 13:18:47 +0000 |
| commit | a23a47457d98aba4ec643f4422f3735d98fab2b4 (patch) | |
| tree | d24766c5283456538f9371e387552b1f8e64b76f /addons | |
| parent | 8d34e1606f930deaa148563ffd40c69457650305 (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>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account/wizard/account_automatic_entry_wizard.py | 2 |
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")) |
