[Erp5-report] r25591 - /erp5/trunk/products/ERP5/Document/TaxLine.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Feb 17 10:30:50 CET 2009


Author: yo
Date: Tue Feb 17 10:30:49 2009
New Revision: 25591

URL: http://svn.erp5.org?rev=25591&view=rev
Log:
Tax Lines should not be accountable inside Accounting Transactions, because accounting is done with Accounting Transaction Lines, thus the information is added twice in the inventory.

Modified:
    erp5/trunk/products/ERP5/Document/TaxLine.py

Modified: erp5/trunk/products/ERP5/Document/TaxLine.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/TaxLine.py?rev=25591&r1=25590&r2=25591&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/TaxLine.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/TaxLine.py [utf8] Tue Feb 17 10:30:49 2009
@@ -64,8 +64,19 @@
     security.declareProtected(Permissions.AccessContentsInformation,
                               'isAccountable')
     def isAccountable(self):
-      """ """
-      return 1 # XXX not sure
+      """Return true if the parent is accountable and
+      not an accounting transaction.
+
+      NOTE: this is because, if the parent is an accounting transaction,
+      the accounting is done with another accounting transaction line,
+      so making tax lines accountable would duplicate the accounting.
+      """
+      delivery = self.getParentValue()
+      if delivery.isAccountable(): 
+        portal = delivery.getPortalObject()
+        type_list = portal.getPortalAccountingTransactionTypeList()
+        return delivery.getPortalType() not in type_list
+      return 0
 
     security.declareProtected(Permissions.AccessContentsInformation,
                               'hasCellContent')




More information about the Erp5-report mailing list