[IMP] l10n_lu: Code improved

bzr revid: mra@mra-laptop-20100818052854-j9k789yn5pgjhhge
This commit is contained in:
Mustufa Rangwala 2010-08-18 10:58:54 +05:30
parent 18b8ed7835
commit 90d2842db3
4 changed files with 3737 additions and 3728 deletions

View File

@ -42,6 +42,7 @@ This module installs:
],
'demo_xml': ['account.report.report.csv'],
'installable': True,
'active': False,
'certificate': '0078164766621',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,6 @@
#Tranquil IT Systems
from osv import osv, fields
import pooler
import tools
from tools.translate import _
@ -13,20 +12,25 @@ from report.render import render
from report.interface import report_int
class external_pdf(render):
def __init__(self, pdf):
render.__init__(self)
self.pdf = pdf
self.output_type='pdf'
def _render(self):
return self.pdf
class report_custom(report_int):
def create(self, cr, uid, ids, datas, context={}):
def create(self, cr, uid, ids, datas, context=None):
pool = pooler.get_pool(cr.dbname)
taxobj = pool.get('account.tax.code')
if context is None:
context = {}
code_ids = taxobj.search(cr, uid, [('parent_id','child_of',[datas['form']['tax_code_id']])])
result = {}
for t in taxobj.browse(cr, uid, code_ids, {'period_id': datas['form']['period_id']}):
@ -54,12 +58,12 @@ report_custom('report.l10n_lu.tax.report.print')
class vat_declaration_report(osv.osv_memory):
_name = 'vat.declaration.report'
_description = 'VAT Declaration Report'
_columns = {
'tax_code_id': fields.many2one('account.tax.code', 'Company', required=True, domain=[('parent_id','=',False)]),
'tax_code_id': fields.many2one('account.tax.code', 'Company', readonly=False, required=True, domain=[('parent_id','=',False)]),
'period_id' : fields.many2one('account.period', 'Period', required=True)
}
}
def print_vat_declaration_report(self, cr, uid, ids, context=None):
active_ids = context.get('active_ids',[])
data = {}
@ -71,4 +75,4 @@ class vat_declaration_report(osv.osv_memory):
vat_declaration_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -6,7 +6,7 @@
<field name="model">vat.declaration.report</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form>
<form string="Print Tax Statements">
<field name="tax_code_id" widget="selection"/>
<field name="period_id" widget="selection"/>
<separator colspan="4"/>
@ -30,5 +30,6 @@
<menuitem id="legal_lu" parent="account.menu_finance_legal_statement" name="Luxembourg"/>
<menuitem name="VAT Declaration" id="legal_lu_vat" parent="legal_lu" action="action_vat_report"/>
</data>
</openerp>