Commit 4fb9e633 authored by Mame Coumba Sall's avatar Mame Coumba Sall

Add custom setPosted method so that reference is automatically

updated everytime setPosted is called


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31852 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e0c7eabc
...@@ -90,6 +90,15 @@ class BankingOperation(BaobabMixin, AccountingTransaction): ...@@ -90,6 +90,15 @@ class BankingOperation(BaobabMixin, AccountingTransaction):
else: else:
return src.getInternalBankAccountNumber(default) return src.getInternalBankAccountNumber(default)
security.declareProtected(Permissions.View, 'setPosted')
def setPosted(self, value):
"""
Custom method that's automatically sets the reference
of the account transfer
"""
if self.getPortalType()=="Account Transfer":
self.setReference("posted")
return self._setPosted(value)
### Dynamic patch ### Dynamic patch
Delivery.getBaobabSourceUid = lambda x: x.getSourceUid() Delivery.getBaobabSourceUid = lambda x: x.getSourceUid()
Delivery.getBaobabSourceUid__roles__ = PermissionRole(Permissions.View) Delivery.getBaobabSourceUid__roles__ = PermissionRole(Permissions.View)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment