Fix bug when reschedule the move_lines based on amount.

This commit is contained in:
Bernat Brunet 2023-05-31 18:38:37 +02:00
parent 45614de84a
commit 359d3116c9
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,20 @@
diff --git a/tryton/modules/account/move.py b/tryton/modules/account/move.py
index e9123a42a9..f8a7d3209c 100644
--- a/tryton/modules/account/move.py
+++ b/tryton/modules/account/move.py
@@ -2348,12 +2348,14 @@ class RescheduleLines(Wizard):
and self.start.interval
and self.start.currency):
remaining = self.start.total_amount
+ total = self.start.total_amount
date = self.start.start_date
values['terms'] = terms = []
if self.start.amount:
interval = self.start.interval
amount = self.start.amount.copy_sign(remaining)
- while remaining - amount > 0:
+ while ((total > 0 and remaining - amount > 0)
+ or (total < 0 and remaining - amount < 0)):
terms.append({
'date': date,
'amount': amount,

2
series
View File

@ -57,3 +57,5 @@ issue11306.diff # [analytic_invocie] Add compatibility between the analytic_invo
strftime_format.diff # [ir] Fix problem with strftime format, reducing the time needed to format standard time. When the %A or %B is not used.
counterpart_party_payment_clearing.diff # [account_payment_clearing] Add the possiblity to have a party in the counterpart move when reconcile on a payment.
account_move_reschedule_line.diff # [account] Fix bug when reschedule the move_lines based on amount.