Commit 3f949f09 authored by Jérome Perrin's avatar Jérome Perrin

enable currency conversion


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5004 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 91c85f24
......@@ -132,7 +132,7 @@ class AccountingTransactionLine(DeliveryLine):
"""
if kw.has_key('source'):
self._setSource(kw['source'])
if kw.has_key('destination') and not kw.has_key('source'):
elif kw.has_key('destination') :
self._setDestination(kw['destination'])
DeliveryLine._edit(self, REQUEST=REQUEST, force_update = force_update, **kw)
......@@ -175,14 +175,13 @@ class AccountingTransactionLine(DeliveryLine):
"""
result = self.getInventoriatedQuantity()
resource = self.getResourceValue()
source = self.getSourceValue()
source_section = self.getSourceSectionValue()
if source is not None and resource is not None:
# XXX convertCurrency is not defined
# ... so for now, we return 1
return 1
if source_section is not None and \
resource is not None and \
hasattr(resource, 'convertCurrency') :
return resource.convertCurrency(result,
source.getPriceCurrencyValue())
source_section.getPriceCurrencyValue())
return None
security.declareProtected(Permissions.AccessContentsInformation, 'getSourceAssetPrice')
......@@ -203,4 +202,4 @@ class AccountingTransactionLine(DeliveryLine):
This is required by accounting law. One can not account USD (in a EUR based company)
without defining the equivalent in EUR.
"""
return 1.0
\ No newline at end of file
return 1.0
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