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): ...@@ -132,7 +132,7 @@ class AccountingTransactionLine(DeliveryLine):
""" """
if kw.has_key('source'): if kw.has_key('source'):
self._setSource(kw['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']) self._setDestination(kw['destination'])
DeliveryLine._edit(self, REQUEST=REQUEST, force_update = force_update, **kw) DeliveryLine._edit(self, REQUEST=REQUEST, force_update = force_update, **kw)
...@@ -175,14 +175,13 @@ class AccountingTransactionLine(DeliveryLine): ...@@ -175,14 +175,13 @@ class AccountingTransactionLine(DeliveryLine):
""" """
result = self.getInventoriatedQuantity() result = self.getInventoriatedQuantity()
resource = self.getResourceValue() resource = self.getResourceValue()
source = self.getSourceValue() source_section = self.getSourceSectionValue()
if source is not None and resource is not None: if source_section is not None and \
# XXX convertCurrency is not defined resource is not None and \
# ... so for now, we return 1 hasattr(resource, 'convertCurrency') :
return 1
return resource.convertCurrency(result, return resource.convertCurrency(result,
source.getPriceCurrencyValue()) source_section.getPriceCurrencyValue())
return None return None
security.declareProtected(Permissions.AccessContentsInformation, 'getSourceAssetPrice') security.declareProtected(Permissions.AccessContentsInformation, 'getSourceAssetPrice')
...@@ -203,4 +202,4 @@ class AccountingTransactionLine(DeliveryLine): ...@@ -203,4 +202,4 @@ class AccountingTransactionLine(DeliveryLine):
This is required by accounting law. One can not account USD (in a EUR based company) This is required by accounting law. One can not account USD (in a EUR based company)
without defining the equivalent in EUR. without defining the equivalent in EUR.
""" """
return 1.0 return 1.0
\ 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