[Erp5-report] r10909 - in /erp5/trunk/products/ERP5: PropertySheet/ tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Oct 24 16:11:32 CEST 2006


Author: jerome
Date: Tue Oct 24 16:11:28 2006
New Revision: 10909

URL: http://svn.erp5.org?rev=10909&view=rev
Log:
'is_credit_account' was a bad property name, change it to 'credit_account'.


Modified:
    erp5/trunk/products/ERP5/PropertySheet/Account.py
    erp5/trunk/products/ERP5/tests/testAccounting.py

Modified: erp5/trunk/products/ERP5/PropertySheet/Account.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/PropertySheet/Account.py?rev=10909&r1=10908&r2=10909&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/PropertySheet/Account.py (original)
+++ erp5/trunk/products/ERP5/PropertySheet/Account.py Tue Oct 24 16:11:28 2006
@@ -32,11 +32,10 @@
   """
 
   _properties = (
-      { 'id'          : 'is_credit_account', # XXX: this property should be
-                                             # named diferently : an account can
-                                             # be naturally debitor, creditor,
-                                             # or none of those
-      'description' : 'Some accounts are',
+      { 'id'        : 'credit_account',
+      'storage_id'  : 'is_credit_account',
+      'description' : 'Set to true if this account have a normal balance of'\
+                      ' debit.',
       'type'        : 'boolean',
       'mode'        : 'w' ,
       'default'     : 0 },

Modified: erp5/trunk/products/ERP5/tests/testAccounting.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testAccounting.py?rev=10909&r1=10908&r2=10909&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testAccounting.py (original)
+++ erp5/trunk/products/ERP5/tests/testAccounting.py Tue Oct 24 16:11:28 2006
@@ -1318,6 +1318,21 @@
     self.assertRaises(ValidationFailed, self.getWorkflowTool().doActionFor,
                       transaction, 'stop_action')
 
+  def test_Account_isCreditAccount(self):
+    """Tests the 'credit_account' property on account, which was named
+    is_credit_account, which generated isIsCreditAccount accessor"""
+    account = self.getAccountModule().newContent(portal_type='Account')
+    # simulate an old object
+    account.is_credit_account = True
+
+    account.setCreditAccount(True)
+    self.failUnless(account.isCreditAccount())
+    
+    # this is what Account_view would do when you update the code before
+    # without updating business template.
+    account.edit(is_credit_account=False)
+    self.failIf(account.isCreditAccount())
+    
 if __name__ == '__main__':
   framework()
 else:




More information about the Erp5-report mailing list