Commit b348d24b authored by Jérome Perrin's avatar Jérome Perrin

don't force destination to None on Balance Transaction Line


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15791 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f965728e
...@@ -80,9 +80,6 @@ class AccountingTransactionLine(DeliveryLine): ...@@ -80,9 +80,6 @@ class AccountingTransactionLine(DeliveryLine):
mirror_list = [] mirror_list = []
if len(mirror_list) > 0 and destination not in mirror_list: if len(mirror_list) > 0 and destination not in mirror_list:
self._setCategoryMembership('destination', mirror_list[0], base=0) self._setCategoryMembership('destination', mirror_list[0], base=0)
else:
# Force to set the destination to None.
self._setCategoryMembership('destination', None, base=0)
security.declareProtected(Permissions.ModifyPortalContent, 'setSource') security.declareProtected(Permissions.ModifyPortalContent, 'setSource')
def setSource(self, value): def setSource(self, value):
...@@ -99,10 +96,10 @@ class AccountingTransactionLine(DeliveryLine): ...@@ -99,10 +96,10 @@ class AccountingTransactionLine(DeliveryLine):
Set the destination Account and implicitely the source Account Set the destination Account and implicitely the source Account
using the source's mirror account. using the source's mirror account.
""" """
self._setCategoryMembership('destination', value, base=0)
if self.getPortalType() not in \ if self.getPortalType() not in \
self.getPortalBalanceTransactionLineTypeList()\ self.getPortalBalanceTransactionLineTypeList()\
and value not in (None, ''): and value not in (None, ''):
self._setCategoryMembership('destination', value, base=0)
destination = self.getPortalObject().\ destination = self.getPortalObject().\
portal_categories.resolveCategory(value) portal_categories.resolveCategory(value)
source = self.getSource() source = self.getSource()
...@@ -112,9 +109,6 @@ class AccountingTransactionLine(DeliveryLine): ...@@ -112,9 +109,6 @@ class AccountingTransactionLine(DeliveryLine):
mirror_list = [] mirror_list = []
if len(mirror_list) > 0 and source not in mirror_list: if len(mirror_list) > 0 and source not in mirror_list:
self._setCategoryMembership('source', mirror_list[0], base=0) self._setCategoryMembership('source', mirror_list[0], base=0)
else:
# Force to set the destination to None.
self._setCategoryMembership('destination', None, base=0)
security.declareProtected(Permissions.ModifyPortalContent, 'setDestination') security.declareProtected(Permissions.ModifyPortalContent, 'setDestination')
def setDestination(self, value): def setDestination(self, value):
......
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