From 6cc55075f5c7d91cca02e823d20df6304d9e8fca Mon Sep 17 00:00:00 2001 From: Jay Vora Date: Fri, 7 Nov 2008 18:52:04 +0530 Subject: [PATCH] Modified indicators :added second optional arguement and added tax_code expression bzr revid: jvo@tinyerp.com-20081107132204-60fe2uxu1wgmxiig --- addons/account/account.py | 7 +++-- addons/account_report/account.py | 46 +++++++++++++++++++++++++++--- addons/l10n_lu/wizard/print_vat.py | 4 +-- 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 6512a9c1c1a..6c19f176ceb 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1072,13 +1072,14 @@ class account_tax_code(osv.osv): return res def _sum_period(self, cr, uid, ids, name, args, context): - if not 'period_id' in context: + if 'period_id' in context and context['period_id']: + period_id = context['period_id'] + else: period_id = self.pool.get('account.period').find(cr, uid) if not len(period_id): return dict.fromkeys(ids, 0.0) period_id = period_id[0] - else: - period_id = context['period_id'] + return self._sum(cr, uid, ids, name, args, context, where=' and line.period_id='+str(period_id)) diff --git a/addons/account_report/account.py b/addons/account_report/account.py index 766cc9d7a33..7ba76c80dc7 100644 --- a/addons/account_report/account.py +++ b/addons/account_report/account.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved # $Id$ # @@ -53,15 +53,44 @@ class account_report(osv.osv): # ] def _amount_get(self, cr, uid, ids, field_name, arg, context={}): - def _calc_credit(*code): + obj_fy=self.pool.get('account.fiscalyear') + obj_period=self.pool.get('account.period') + + def _calc_context(key,obj): + print "for @@@@@@@@@@@@",obj + if key==0: + print "ddddddddd",obj.find(cr,uid) + return obj.find(cr,uid) + else: + obj_key=obj.browse(cr,uid,obj.find(cr,uid)) + print "obj_key",obj_key + key_ids=obj.search(cr,uid,[('date_stop','<',obj_key.date_start)]) + if len(key_ids)
@@ -69,7 +69,7 @@ class report_custom(report_int): result['info_address'] = partner.address[0].street result['info_address2'] = str(partner.address[0].zip) + ' ' + str(partner.address[0].city) - pdf_ext.fill_pdf(tools.config['addons_path']+'/l10n_lu/wizard/2008_DECL_F_M10.pdf', '/tmp/output.pdf', result) + tools.pdf_utils.fill_pdf(tools.config['addons_path']+'/l10n_lu/wizard/2008_DECL_F_M10.pdf', '/tmp/output.pdf', result) self.obj = external_pdf(file('/tmp/output.pdf').read()) self.obj.render() return (self.obj.pdf, 'pdf')