From dd50d55b8d283934c2cb97849790a4da8c1f9c9b Mon Sep 17 00:00:00 2001 From: mtr Date: Thu, 18 Nov 2010 13:57:59 +0530 Subject: [PATCH 1/6] [IMP] Account: Partner Ledger Report-cummulative balance bzr revid: mtr@mtr-20101118082759-3sztv3si7sc5kztj --- addons/account/report/account_journal.py | 1 + addons/account/report/account_partner_ledger.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/account/report/account_journal.py b/addons/account/report/account_journal.py index 82af01cdb0b..9bf5b026206 100644 --- a/addons/account/report/account_journal.py +++ b/addons/account/report/account_journal.py @@ -120,6 +120,7 @@ class journal_print(report_sxw.rml_parse, common_report_header): self.cr.execute('SELECT l.id FROM account_move_line l, account_move am WHERE l.move_id=am.id AND am.state IN %s AND l.period_id=%s AND l.journal_id IN %s ' + self.query_get_clause + ' ORDER BY l.'+ self.sort_selection + '',(tuple(move_state), period_id, tuple(journal_id) )) ids = map(lambda x: x[0], self.cr.fetchall()) + print"--ids--",ids return obj_mline.browse(self.cr, self.uid, ids) def _set_get_account_currency_code(self, account_id): diff --git a/addons/account/report/account_partner_ledger.py b/addons/account/report/account_partner_ledger.py index e66c3a9d523..79ae0ce83cf 100644 --- a/addons/account/report/account_partner_ledger.py +++ b/addons/account/report/account_partner_ledger.py @@ -152,8 +152,10 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header): (partner.id, tuple(self.account_ids), tuple(move_state))) res = self.cr.dictfetchall() sum = 0.0 + if self.initial_balance: + sum = self.init_bal_sum for r in res: - sum = r['debit'] - r['credit'] + sum += r['debit'] - r['credit'] r['progress'] = sum full_account.append(r) return full_account @@ -178,7 +180,9 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header): " " + RECONCILE_TAG + " "\ "AND " + self.init_query + " ", (partner.id, tuple(move_state), tuple(self.account_ids))) - return self.cr.fetchall() + res = self.cr.fetchall() + self.init_bal_sum = res[0][2] + return res def _sum_debit_partner(self, partner): move_state = ['draft','posted'] From f6616b83a664df826c62d7b34ccb98e5de353297 Mon Sep 17 00:00:00 2001 From: mtr Date: Fri, 19 Nov 2010 10:23:49 +0530 Subject: [PATCH 2/6] [IMP] Account:removed the print statement bzr revid: mtr@mtr-20101119045349-v1ww46vd0vkixz6m --- addons/account/report/account_journal.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/account/report/account_journal.py b/addons/account/report/account_journal.py index 9bf5b026206..82af01cdb0b 100644 --- a/addons/account/report/account_journal.py +++ b/addons/account/report/account_journal.py @@ -120,7 +120,6 @@ class journal_print(report_sxw.rml_parse, common_report_header): self.cr.execute('SELECT l.id FROM account_move_line l, account_move am WHERE l.move_id=am.id AND am.state IN %s AND l.period_id=%s AND l.journal_id IN %s ' + self.query_get_clause + ' ORDER BY l.'+ self.sort_selection + '',(tuple(move_state), period_id, tuple(journal_id) )) ids = map(lambda x: x[0], self.cr.fetchall()) - print"--ids--",ids return obj_mline.browse(self.cr, self.uid, ids) def _set_get_account_currency_code(self, account_id): From b058cbe6b44dde3c5fd068acb5b34826f46186dd Mon Sep 17 00:00:00 2001 From: mtr Date: Mon, 22 Nov 2010 12:26:42 +0530 Subject: [PATCH 3/6] [IMP] Account: declare a variable in __init__ method bzr revid: mtr@mtr-20101122065642-mpp9eru00zptxano --- addons/account/report/account_partner_ledger.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account/report/account_partner_ledger.py b/addons/account/report/account_partner_ledger.py index 79ae0ce83cf..8d3bc8c55b0 100644 --- a/addons/account/report/account_partner_ledger.py +++ b/addons/account/report/account_partner_ledger.py @@ -28,6 +28,7 @@ class third_party_ledger(report_sxw.rml_parse, common_report_header): def __init__(self, cr, uid, name, context=None): super(third_party_ledger, self).__init__(cr, uid, name, context=context) + self.init_bal_sum = 0.0 self.localcontext.update({ 'time': time, 'lines': self.lines, From 648aca8ca01e25e041fcea9ca25a23fa69115e7b Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Mon, 22 Nov 2010 13:38:06 +0530 Subject: [PATCH 4/6] [REF] Account_sequence: add help tooltip on internal number field bzr revid: mra@mra-laptop-20101122080806-h3ptk0sfkrbivryf --- addons/account_sequence/account_sequence.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_sequence/account_sequence.py b/addons/account_sequence/account_sequence.py index 39b2327452d..309bf3bc803 100644 --- a/addons/account_sequence/account_sequence.py +++ b/addons/account_sequence/account_sequence.py @@ -26,7 +26,7 @@ class account_move(osv.osv): _inherit = 'account.move' _columns = { - 'internal_sequence_number': fields.char('Internal Number', size=64, readonly=True), + 'internal_sequence_number': fields.char('Internal Number', size=64, readonly=True, help='Internal Sequence Number'), } def post(self, cr, uid, ids, context=None): @@ -55,7 +55,7 @@ class account_move_line(osv.osv): _inherit = "account.move.line" _columns = { - 'internal_sequence_number': fields.related('move_id','internal_sequence_number', type='char', relation='account.move', string='Internal Number'), + 'internal_sequence_number': fields.related('move_id','internal_sequence_number', type='char', relation='account.move', help='Internal Sequence Number', string='Internal Number'), } account_move_line() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file From b432214145445453262462476c914dcaca025e9e Mon Sep 17 00:00:00 2001 From: Mustufa Rangwala Date: Mon, 22 Nov 2010 14:23:19 +0530 Subject: [PATCH 5/6] [REM] pos: Remove cash journal as it available from account and no more refrence on pos too bzr revid: mra@mra-laptop-20101122085319-kw1nyxq03ce57brp --- addons/point_of_sale/account_statement_demo.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/account_statement_demo.xml b/addons/point_of_sale/account_statement_demo.xml index 3862c3c97cb..c4850ded0a3 100644 --- a/addons/point_of_sale/account_statement_demo.xml +++ b/addons/point_of_sale/account_statement_demo.xml @@ -13,7 +13,7 @@ - + Bancontact Journal From e3fdc5e3291dccbb615c20f87f5aa4aa6918a593 Mon Sep 17 00:00:00 2001 From: "ARA (OpenERP)" Date: Mon, 22 Nov 2010 15:20:07 +0530 Subject: [PATCH 6/6] [REF] point_of_sale: fix the yml partner_id warning bzr revid: ara@tinyerp.com-20101122095007-b5128lopvy02ux1a --- addons/point_of_sale/point_of_sale.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 8bee8a4245c..b4b2ff9cb9f 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -752,6 +752,7 @@ class pos_order(osv.osv): 'period_id': period, 'tax_code_id': tax_code_id, 'tax_amount': tax_amount, + 'partner_id': order.partner_id and order.partner_id.id or False }, context=context) # For each remaining tax with a code, whe create a move line @@ -817,6 +818,7 @@ class pos_order(osv.osv): or 0.0, 'journal_id': order.sale_journal.id, 'period_id': period, + 'partner_id': order.partner_id and order.partner_id.id or False }, context=context))