From f3d14cd792daaa9a466e49798baad4ded51ca0f7 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 29 Oct 2010 16:02:11 +0530 Subject: [PATCH 1/2] [FIX] Account: Partner ledger report => If i have one invoice with Date and period with January-2010 (old) and it is already recoiled/paid. - Now i print the report with Include initial balance option ticked and filter by periods + include Reconciled entries Ticked - Start period => Sep-2010 - End period => Dec-2010 - If i look in the report -> i can not found that reconciled amount for the partner on Initial balance row. bzr revid: mra@mra-laptop-20101029103211-puynyojr919lnsfy --- addons/account/report/account_partner_ledger.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/account/report/account_partner_ledger.py b/addons/account/report/account_partner_ledger.py index 52e012e4460..06475311bf3 100644 --- a/addons/account/report/account_partner_ledger.py +++ b/addons/account/report/account_partner_ledger.py @@ -164,6 +164,10 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): move_state = ['draft','posted'] if self.target_move == 'posted': move_state = ['posted'] + if self.reconcil: + RECONCILE_TAG = " " + else: + RECONCILE_TAG = "AND l.reconcile_id IS NULL" self.cr.execute( "SELECT COALESCE(SUM(l.debit),0.0), COALESCE(SUM(l.credit),0.0), COALESCE(sum(debit-credit), 0.0) " \ @@ -173,7 +177,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): "AND m.id = l.move_id " \ "AND m.state IN %s " "AND account_id IN %s" \ - "AND reconcile_id IS NULL " \ + " " + RECONCILE_TAG + " "\ "AND " + self.init_query + " ", (partner.id, tuple(move_state), tuple(self.account_ids))) return self.cr.fetchall() From 01c028d9f81ab03c7cb914027091eb49b9883fd5 Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Fri, 29 Oct 2010 16:43:28 +0530 Subject: [PATCH 2/2] [REF] decimal_precision: Clean code and missing expandtab link on py file bzr revid: mra@mra-laptop-20101029111328-1f1lho4ibiyepnjg --- addons/decimal_precision/decimal_precision.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/decimal_precision/decimal_precision.py b/addons/decimal_precision/decimal_precision.py index 5dbb2006b52..e91e8d2d1c1 100644 --- a/addons/decimal_precision/decimal_precision.py +++ b/addons/decimal_precision/decimal_precision.py @@ -23,7 +23,6 @@ from osv import osv, fields from tools import cache import pooler - class decimal_precision(osv.osv): _name = 'decimal.precision' _columns = { @@ -31,7 +30,7 @@ class decimal_precision(osv.osv): 'digits': fields.integer('Digits', required=True), } _defaults = { - 'digits': lambda *a : 2, + 'digits': 2, } _sql_constraints = [ @@ -55,10 +54,10 @@ class decimal_precision(osv.osv): decimal_precision() - def get_precision(application): def change_digit(cr): res = pooler.get_pool(cr.dbname).get('decimal.precision').precision_get(cr, 1, application) return (16, res) return change_digit +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file