[FIX] account: reconciliation model with percentage >100
To reproduce the error:
1. Invoicing > Reconciliation Models > Create
2. Add name
3. (Counterpart Values) Add a line
- Amount Type: Percentage of balance
- Amount: Something bigger than 100
4. Save
=> UserError raised ("The amount is not a percentage")
This is an error. A user should be able to set a percentage greater than 100.
The fix removes the constraint.
OPW-2375462
closes odoo/odoo#62010
X-original-commit: 2776209ba9a437c413dd5670c1695a06da909a5a
Signed-off-by: adwid <adwid@users.noreply.github.com>
This commit is contained in:
@@ -94,7 +94,7 @@ class AccountReconcileModelLine(models.Model):
|
||||
for record in self:
|
||||
if record.amount_type == 'fixed' and record.amount == 0:
|
||||
raise UserError(_('The amount is not a number'))
|
||||
if record.amount_type == 'percentage' and not 0 < record.amount <= 100:
|
||||
if record.amount_type == 'percentage' and not 0 < record.amount:
|
||||
raise UserError(_('The amount is not a percentage'))
|
||||
if record.amount_type == 'regex':
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user