[FIX] account: Fix automatic entry wizard with change_account

'percentage' is computed by default whatever the wizard action (change_period/change_account) but there is a constraint raised when the percentage is != 100 in change_account.

closes odoo/odoo#64743

X-original-commit: 20d6efa817a4d839777c81d403bb8770807e784a
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
This commit is contained in:
Laurent Smet
2021-01-19 11:18:34 +00:00
parent 031088f190
commit 01b27664dd
@@ -49,8 +49,6 @@ class AutomaticEntryWizard(models.TransientModel):
for record in self:
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"))
@api.depends('percentage', 'move_line_ids')
def _compute_total_amount(self):