changeset f8747f61f3c0 in modules/account_payment_sepa:5.6
details: 
https://hg.tryton.org/modules/account_payment_sepa?cmd=changeset;node=f8747f61f3c0
description:
        Use getattr to read move origin's rec_name

        Since changeset b8d76b07910f, the reference value of a negative id is a 
string
        so access it's rec_name crashes.

        issue9773
        review310971002
        (grafted from 792b864de94d8e5af121bfceb47441255c0ce866)
diffstat:

 payment.py |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 1913477d2f6f -r f8747f61f3c0 payment.py
--- a/payment.py        Mon May 04 12:10:43 2020 +0200
+++ b/payment.py        Thu Oct 29 18:26:48 2020 +0100
@@ -364,7 +364,7 @@
         if self.description:
             return self.description
         elif self.line and self.line.move_origin:
-            return self.line.move_origin.rec_name
+            return getattr(self.line.move_origin, 'rec_name', '')
 
     @property
     def sepa_bank_account_number(self):

Reply via email to