From 8af93c2e65f30f4e6707aec0baa6b830af61e364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com> Date: Wed, 18 Apr 2007 08:00:08 +0000 Subject: [PATCH] define new getter for intetnal bank account number git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14107 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../ERP5Banking/Document/BankingOperation.py | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/product/ERP5Banking/Document/BankingOperation.py b/product/ERP5Banking/Document/BankingOperation.py index 1456eaf230..8c51113166 100755 --- a/product/ERP5Banking/Document/BankingOperation.py +++ b/product/ERP5Banking/Document/BankingOperation.py @@ -68,8 +68,28 @@ class BankingOperation(BaobabMixin, AccountingTransaction): """ Delivery.manage_beforeDelete(self, item, container) - - + security.declareProtected(Permissions.View, 'getDestinationPaymentInternalBankAccountNumber') + def getDestinationPaymentInternalBankAccountNumber(self, default=None): + """ + Getter for internal account number + """ + dest = self.getDestinationPaymentValue(default) + if dest is default: + return default + else: + return dest.getInternalBankAccountNumber(default) + + security.declareProtected(Permissions.View, 'getSourcePaymentInternalBankAccountNumber') + def getSourcePaymentInternalBankAccountNumber(self, default=None): + """ + Getter for internal account number + """ + src = self.getSourcePaymentValue(default) + if src is default: + return default + else: + return src.getInternalBankAccountNumber(default) + ### Dynamic patch Delivery.getBaobabSourceUid = lambda x: x.getSourceUid() Delivery.getBaobabSourceUid__roles__ = PermissionRole(Permissions.View) -- 2.30.9