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

Do not convert automatically the price, this should be done by the user.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5282 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4cae47c3
...@@ -134,7 +134,7 @@ class AccountingTransactionLine(DeliveryLine): ...@@ -134,7 +134,7 @@ class AccountingTransactionLine(DeliveryLine):
self._setSource(kw['source']) self._setSource(kw['source'])
elif kw.has_key('destination') : 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)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getInventoriatedQuantity') 'getInventoriatedQuantity')
...@@ -166,40 +166,33 @@ class AccountingTransactionLine(DeliveryLine): ...@@ -166,40 +166,33 @@ class AccountingTransactionLine(DeliveryLine):
security.declareProtected(Permissions.AccessContentsInformation, 'getPrice') security.declareProtected(Permissions.AccessContentsInformation, 'getPrice')
def getPrice(self, context=None): def getPrice(self, context=None):
""" """
The inventoriated quantity converted in a default unit On accounting transaction lines, the price is always set to 1.
We use the `quantity` property for the default quantity, and the
For assortments, returns the inventoriated quantity in terms of converted value for source in getSourceInventoriatedTotalAssetPrice
number of items in the assortemnt. and getDestinationInventoriatedTotalAssetPrice for destination.
For accounting, returns the quantity converted in a default unit
""" """
result = self.getInventoriatedQuantity() return 1.0
resource = self.getResourceValue()
source_section = self.getSourceSectionValue()
if source_section is not None and \
resource is not None and \
hasattr(resource, 'convertCurrency') :
return resource.convertCurrency(result,
source_section.getPriceCurrencyValue())
return None
security.declareProtected(Permissions.AccessContentsInformation, 'getSourceAssetPrice') security.declareProtected(Permissions.AccessContentsInformation,
'getSourceAssetPrice')
def getSourceAssetPrice(self): def getSourceAssetPrice(self):
""" """
The price is set to 1.0 because we do not want to implement automatic currency The price is set to 1.0 because we do not want to implement
conversion in accounting. Users must define the conversion manually in accounting. automatic currency conversion in accounting. Users must define the
This is required by accounting law. One can not account USD (in a EUR based company) conversion manually in accounting. This is required by accounting
without defining the equivalent in EUR. law. One can not account USD (in a EUR based company) without
defining the equivalent in EUR.
""" """
return 1.0 return 1.0
security.declareProtected(Permissions.AccessContentsInformation, 'getDestinationAssetPrice') security.declareProtected(Permissions.AccessContentsInformation,
'getDestinationAssetPrice')
def getDestinationAssetPrice(self): def getDestinationAssetPrice(self):
""" """
The price is set to 1.0 because we do not want to implement automatic currency The price is set to 1.0 because we do not want to implement
conversion in accounting. Users must define the conversion manually in accounting. automatic currency conversion in accounting. Users must define the
This is required by accounting law. One can not account USD (in a EUR based company) conversion manually in accounting. This is required by accounting
without defining the equivalent in EUR. law. One can not account USD (in a EUR based company) without
defining the equivalent in EUR.
""" """
return 1.0 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