Cédric Krier pushed to branch branch/default at Tryton / Tryton


Commits:
a71dff82 by Cédric Krier at 2023-05-05T11:13:43+02:00
Do not compute amount from reconciled lines if there is no currency

Closes #12256
- - - - -
75bd977a by Cédric Krier at 2023-05-05T12:24:08+02:00
Test currency instead of party when reconcile automatically

Closes #12258
- - - - -


1 changed file:

- modules/account/move.py


Changes:

=====================================
modules/account/move.py
=====================================
@@ -2167,8 +2167,9 @@
                 while lines:
                     Line.reconcile(lines)
                     lines = self._default_lines()
-                if not self.get_parties(
-                        self.show.account, party=self.show.party):
+                if not self.get_currencies(
+                        self.show.account, self.show.party,
+                        currency=self.show.currency):
                     return 'next_'
             elif not lines and self.start.only_balanced:
                 return 'next_'
@@ -2359,9 +2360,4 @@
     @fields.depends('lines', 'currency', 'company')
     def on_change_lines(self):
         amount = Decimal(0)
-        for line in self.lines:
-            if line.second_currency == self.currency:
-                amount += line.amount_second_currency
-            elif line.currency == self.currency:
-                amount += line.debit - line.credit
         if self.currency:
@@ -2367,4 +2363,9 @@
         if self.currency:
+            for line in self.lines:
+                if line.second_currency == self.currency:
+                    amount += line.amount_second_currency
+                elif line.currency == self.currency:
+                    amount += line.debit - line.credit
             amount = self.currency.round(amount)
         self.write_off_amount = amount
 



View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/compare/de713297b6e7a908b7b907463b7e11ded62e3c07...75bd977acf69abfcb42333d6352b822790f800e1

-- 
View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/compare/de713297b6e7a908b7b907463b7e11ded62e3c07...75bd977acf69abfcb42333d6352b822790f800e1
You're receiving this email because of your account on foss.heptapod.net.


Reply via email to