Commit 150e50b2 authored by Jérome Perrin's avatar Jérome Perrin

Fix an error when setting a relation field to None (bug #28)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3284 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ab90b57d
......@@ -120,7 +120,7 @@ Une ligne tarifaire."""
security.declarePrivate('_setSource')
def _setSource(self, value):
def _setSource(self, value, portal_type=None):
self._setCategoryMembership('source', value, base=0)
if self.getPortalType() not in self.getPortalBalanceTransactionLineTypeList() and value not in (None, ''):
source = self.getPortalObject().portal_categories.resolveCategory(value)
......@@ -142,7 +142,7 @@ Une ligne tarifaire."""
self.reindexObject()
security.declarePrivate('_setDestination')
def _setDestination(self, value):
def _setDestination(self, value, portal_type=None):
if self.getPortalType() not in self.getPortalBalanceTransactionLineTypeList() and value not in (None, ''):
self._setCategoryMembership('destination', value, base=0)
destination = self.getPortalObject().portal_categories.resolveCategory(value)
......@@ -212,4 +212,4 @@ Une ligne tarifaire."""
return resource.convertCurrency(result, source.getPriceCurrencyValue())
return None
\ No newline at end of file
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