[IMP] account: soldeinit => intial_balance rename field ..changes accoridingly
authorMustufa Rangwala <mra@mra-laptop>
Wed, 28 Jul 2010 11:04:34 +0000 (16:34 +0530)
committerMustufa Rangwala <mra@mra-laptop>
Wed, 28 Jul 2010 11:04:34 +0000 (16:34 +0530)
bzr revid: mra@mra-laptop-20100728110434-6n142k4tt4qn7sg2

addons/account/report/partner_balance.py
addons/account/report/third_party_ledger.py
addons/account/wizard/account_general_ledger_report_view.xml
addons/account/wizard/account_report_partner_balance.py
addons/account/wizard/account_report_partner_balance_view.xml
addons/account/wizard/account_report_partner_ledger.py
addons/account/wizard/account_report_partner_ledger_view.xml

index 0adb0c8..3ef11d4 100644 (file)
@@ -175,7 +175,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
                     "WHERE a.type IN %s " \
                     "AND a.active", (self.ACCOUNT_TYPE,))
         self.account_ids = [a for (a,) in self.cr.fetchall()]
-        self.soldeinit = data['form']['soldeinit'] # for include initial balance
+        self.initial_balance = data['form']['initial_balance'] # for include initial balance
         return super(partner_balance, self).set_context(objects, data, ids, report_type)
 
     def lines(self, data):
@@ -209,7 +209,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
             res = self.cr.dictfetchall()
 
             #For include intial balance..
-            if self.soldeinit:
+            if self.initial_balance:
                 date_init = (datetime.datetime.strptime(self.date_lst[0], "%Y-%m-%d") + timedelta(days=-1)).strftime('%Y-%m-%d')
                 self.cr.execute(
                     "SELECT '1' as type, '' as ref, l.account_id as account_id, '' as account_name, '' as code, '' as name, sum(debit) as debit, sum(credit) as credit, " \
@@ -271,7 +271,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
 
         ## We will now compute Total
         subtotal_row = self._add_subtotal(full_account)
-        if not self.soldeinit:
+        if not self.initial_balance:
             return subtotal_row
 
         #If include initial balance is selected..
@@ -415,7 +415,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
                         "AND l.date IN %s",
                         (tuple(self.account_ids), tuple(self.date_lst)))
             temp_res = float(self.cr.fetchone()[0] or 0.0)
-#            if self.soldeinit:
+#            if self.initial_balance:
 #                date_init = (datetime.datetime.strptime(self.date_lst[0], "%Y-%m-%d") + timedelta(days=-1)).strftime('%Y-%m-%d')
 #                self.cr.execute(
 #                        "SELECT sum(debit) " \
@@ -440,7 +440,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
                         "AND l.date IN %s",
                         (tuple(self.account_ids), tuple(self.date_lst),))
             temp_res = float(self.cr.fetchone()[0] or 0.0)
-#            if self.soldeinit:
+#            if self.initial_balance:
 #                date_init = (datetime.datetime.strptime(self.date_lst[0], "%Y-%m-%d") + timedelta(days=-1)).strftime('%Y-%m-%d')
 #                self.cr.execute(
 #                        "SELECT sum(credit) " \
@@ -466,7 +466,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
                         "AND l.blocked=TRUE ",
                         (tuple(self.account_ids), tuple(self.date_lst),))
             temp_res = float(self.cr.fetchone()[0] or 0.0)
-#            if self.soldeinit:
+#            if self.initial_balance:
 #                date_init = (datetime.datetime.strptime(self.date_lst[0], "%Y-%m-%d") + timedelta(days=-1)).strftime('%Y-%m-%d')
 #                self.cr.execute(
 #                        "SELECT sum(debit-credit) " \
index bf5bd14..ef27c1a 100644 (file)
@@ -166,7 +166,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
         self.account_ids = [a for (a,) in self.cr.fetchall()]
         partner_to_use = []
 
-        if self.date_lst and data['form']['soldeinit'] :
+        if self.date_lst and data['form']['initial_balance'] :
             self.cr.execute(
                 "SELECT DISTINCT line.partner_id " \
                 "FROM account_move_line AS line, account_account AS account " \
@@ -212,7 +212,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
         else:
             RECONCILE_TAG = "AND l.reconcile_id IS NULL"
 
-#        if data['form']['soldeinit'] :
+#        if data['form']['initial_balance'] :
 #
 #            self.cr.execute(
 #                    "SELECT l.id,l.date,j.code, l.ref, l.name, l.debit, l.credit " \
@@ -259,7 +259,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
             RECONCILE_TAG = " "
         else:
             RECONCILE_TAG = "AND reconcile_id IS NULL"
-        if self.date_lst and data['form']['soldeinit'] :
+        if self.date_lst and data['form']['initial_balance'] :
             self.cr.execute(
                 "SELECT sum(debit) " \
                 "FROM account_move_line " \
@@ -297,7 +297,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
             RECONCILE_TAG = " "
         else:
             RECONCILE_TAG = "AND reconcile_id IS NULL"
-        if self.date_lst and data['form']['soldeinit'] :
+        if self.date_lst and data['form']['initial_balance'] :
             self.cr.execute(
                     "SELECT sum(credit) " \
                     "FROM account_move_line " \
@@ -337,7 +337,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
             RECONCILE_TAG = " "
         else:
             RECONCILE_TAG = "AND reconcile_id IS NULL"
-        if self.date_lst and data['form']['soldeinit'] :
+        if self.date_lst and data['form']['initial_balance'] :
             self.cr.execute(
                     "SELECT sum(debit) " \
                     "FROM account_move_line " \
@@ -375,7 +375,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
             RECONCILE_TAG = " "
         else:
             RECONCILE_TAG = "AND reconcile_id IS NULL"
-        if self.date_lst and data['form']['soldeinit'] :
+        if self.date_lst and data['form']['initial_balance'] :
             self.cr.execute(
                     "SELECT sum(credit) " \
                     "FROM account_move_line " \
index 28d5fca..f98e80f 100644 (file)
@@ -17,7 +17,7 @@
                            <field name="display_account" required="True"/>
                            <field name="sortbydate" required="True"/>
 
-                           <field name="soldeinit" invisible="1"/>
+                           <field name="initial_balance" invisible="1"/>
 
                            <field name="landscape"/>
                            <field name="amount_currency"/>
index f8035b8..cadce66 100644 (file)
@@ -29,18 +29,18 @@ class account_partner_balance(osv.osv_memory):
     _name = 'account.partner.balance'
     _description = 'Print Account Partner Balance'
     _columns = {
-        'soldeinit': fields.boolean('Include Initial Balances'
+        'initial_balance': fields.boolean('Include Initial Balances'
                                     ,help='It adds initial balance row on report which display previous sum amount of debit/credit/balance'),
                 }
     _defaults = {
-        'soldeinit': True,
+        'initial_balance': True,
                 }
 
     def _print_report(self, cr, uid, ids, data, query_line, context=None):
         if context is None:
             context = {}
         data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
-        data['form'].update(self.read(cr, uid, ids, ['soldeinit'])[0])
+        data['form'].update(self.read(cr, uid, ids, ['initial_balance'])[0])
         return {
             'type': 'ir.actions.report.xml',
             'report_name': 'account.partner.balance',
index fc8702c..c78d2f3 100644 (file)
@@ -10,7 +10,7 @@
             <field name="arch" type="xml">
                <field name="fiscalyear_id" position="after">
                                        <field name="result_selection"/>
-                                       <field name="soldeinit"/>
+                                       <field name="initial_balance"/>
                                        <newline/>
                </field>
             </field>
index a020ce5..3b89ebe 100644 (file)
@@ -29,7 +29,7 @@ class account_partner_ledger(osv.osv_memory):
     _inherit = 'account.common.partner.report'
     _description = 'Account Partner Ledger'
     _columns = {
-        'soldeinit': fields.boolean('Include initial balances',
+        'initial_balance': fields.boolean('Include initial balances',
                                     help='It adds initial balance row on report which display previous sum amount of debit/credit/balance'),
         'reconcil': fields.boolean('Include Reconciled Entries'),
         'page_split': fields.boolean('One Partner Per Page', help='Display Ledger Report with One partner per page'),
@@ -37,7 +37,7 @@ class account_partner_ledger(osv.osv_memory):
                 }
     _defaults = {
        'reconcile' : True,
-       'soldeinit' : True,
+       'initial_balance' : True,
        'page_split' : False,
                }
 
@@ -45,7 +45,7 @@ class account_partner_ledger(osv.osv_memory):
         if context is None:
             context = {}
         data = self.pre_print_report(cr, uid, ids, data, query_line, context=context)
-        data['form'].update(self.read(cr, uid, ids, ['soldeinit', 'reconcil', 'page_split', 'amount_currency'])[0])
+        data['form'].update(self.read(cr, uid, ids, ['initial_balance', 'reconcil', 'page_split', 'amount_currency'])[0])
         if data['form']['page_split']:
             return {
                 'type': 'ir.actions.report.xml',
index f117e50..3d712b0 100644 (file)
@@ -10,7 +10,7 @@
             <field name="arch" type="xml">
                <field name="fiscalyear_id" position="after">
                                <field name="result_selection"/>
-                                       <field name="soldeinit"/>
+                                       <field name="initial_balance"/>
                                        <field name="reconcil"/>
                                        <field name="page_split"/>
                                        <field name="amount_currency"/>