diff --git a/addons/l10n_lu/__init__.py b/addons/l10n_lu/__init__.py index 0e933f136e0..9a6ca02408e 100644 --- a/addons/l10n_lu/__init__.py +++ b/addons/l10n_lu/__init__.py @@ -19,6 +19,4 @@ # ############################################################################## -import wizard - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_lu/__openerp__.py b/addons/l10n_lu/__openerp__.py index 46d2312bb02..96c4ea64dea 100644 --- a/addons/l10n_lu/__openerp__.py +++ b/addons/l10n_lu/__openerp__.py @@ -22,7 +22,6 @@ # ############################################################################## - { 'name': 'Luxembourg - Accounting', 'version': '1.0', @@ -51,12 +50,12 @@ This is the base module to manage the accounting chart for Luxembourg. 'account.fiscal.position.tax.template-2011.csv', # configuration wizard, views, reports... 'l10n_lu_wizard.xml', - 'wizard/print_vat_view.xml' ], - 'test': ['test/l10n_lu_report.yml'], + 'test': [], 'demo': [], 'installable': True, 'auto_install': False, 'images': ['images/config_chart_l10n_lu.jpeg','images/l10n_lu_chart.jpeg'], } + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_lu/test/l10n_lu_report.yml b/addons/l10n_lu/test/l10n_lu_report.yml deleted file mode 100644 index 0ee032d581c..00000000000 --- a/addons/l10n_lu/test/l10n_lu_report.yml +++ /dev/null @@ -1,18 +0,0 @@ -- - It is demo data for the account.tax.code -- - !record {model: account.tax.code, id: account_tax_code_id_r1}: - name: a - -- - In order to test the PDF reports defined on a l10u_lu, we will print a VAT Report -- - !python {model: res.partner}: | - import os - import openerp.report - from openerp import tools - data, format = openerp.report.render_report(cr, uid, [], 'l10n_lu.tax.report.print', {'model':'ir.ui.menu', 'form':{'tax_code_id': ref('account_tax_code_id_r1'), 'period_id': ref('account.period_1')}}, {}) - if tools.config['test_report_directory']: - file(os.path.join(tools.config['test_report_directory'], 'l10n_lu-vat_report.'+format), 'wb+').write(data) - - diff --git a/addons/l10n_lu/wizard/TVA_MEN_09_xxxx.pdf b/addons/l10n_lu/wizard/TVA_MEN_09_xxxx.pdf deleted file mode 100644 index 9df4ae34065..00000000000 Binary files a/addons/l10n_lu/wizard/TVA_MEN_09_xxxx.pdf and /dev/null differ diff --git a/addons/l10n_lu/wizard/TVA_TRI_10_xxxx.pdf b/addons/l10n_lu/wizard/TVA_TRI_10_xxxx.pdf deleted file mode 100644 index 0699bbcb7d9..00000000000 Binary files a/addons/l10n_lu/wizard/TVA_TRI_10_xxxx.pdf and /dev/null differ diff --git a/addons/l10n_lu/wizard/__init__.py b/addons/l10n_lu/wizard/__init__.py deleted file mode 100644 index 140f04905ab..00000000000 --- a/addons/l10n_lu/wizard/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -import print_vat - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_lu/wizard/pdf_ext.py b/addons/l10n_lu/wizard/pdf_ext.py deleted file mode 100644 index 94f150e41d7..00000000000 --- a/addons/l10n_lu/wizard/pdf_ext.py +++ /dev/null @@ -1,110 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -""" Copyright (c) 2003-2007 LOGILAB S.A. (Paris, FRANCE). - http://www.logilab.fr/ -- mailto:contact@logilab.fr - -manipulate pdf and fdf files. pdftk recommended. - -Notes regarding pdftk, pdf forms and fdf files (form definition file) -fields names can be extracted with: - pdftk orig.pdf generate_fdf output truc.fdf -to merge fdf and pdf: - pdftk orig.pdf fill_form test.fdf output result.pdf [flatten] -without flatten, one could further edit the resulting form. -with flatten, everything is turned into text. -""" - -import os -from openerp import tools - -HEAD="""%FDF-1.2 -%\xE2\xE3\xCF\xD3 -1 0 obj -<< -/FDF -<< -/Fields [ -""" - -TAIL="""] ->> ->> -endobj -trailer - -<< -/Root 1 0 R ->> -%%EOF -""" - -def output_field(f): - return "\xfe\xff" + "".join( [ "\x00"+c for c in f ] ) - -def extract_keys(lines): - keys = [] - for line in lines: - if line.startswith('/V'): - pass - elif line.startswith('/T'): - key = line[7:-2] - key = ''.join(key.split('\x00')) - keys.append( key ) - return keys - -def write_field(out, key, value): - out.write("<<\n") - if value: - out.write("/V (%s)\n" %value) - else: - out.write("/V /\n") - out.write("/T (%s)\n" % output_field(key) ) - out.write(">> \n") - -def write_fields(out, fields): - out.write(HEAD) - for key in fields: - value = fields[key] - write_field(out, key, value) - out.write(TAIL) - -def extract_keys_from_pdf(filename): - # what about using 'pdftk filename dump_data_fields' and parsing the output ? - os.system('pdftk %s generate_fdf output /tmp/toto.fdf' % filename) - lines = file('/tmp/toto.fdf').readlines() - return extract_keys(lines) - - -def fill_pdf(infile, outfile, fields): - write_fields(file('/tmp/toto.fdf', 'w'), fields) - os.system('pdftk %s fill_form /tmp/toto.fdf output %s flatten' % (infile, outfile)) - -def testfill_pdf(infile, outfile): - keys = extract_keys_from_pdf(infile) - fields = [] - for key in keys: - fields.append( (key, key, '') ) - fill_pdf(infile, outfile, fields) - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/l10n_lu/wizard/print_vat.py b/addons/l10n_lu/wizard/print_vat.py deleted file mode 100644 index 04d4fe9a3b7..00000000000 --- a/addons/l10n_lu/wizard/print_vat.py +++ /dev/null @@ -1,96 +0,0 @@ -# -*- coding: utf-8 -*- -#Copyright (c) Vincent Cardon -# Denis Cardon and Emmanuel RICHARD. -#Ingenieur fondateur -#Tranquil IT Systems - -from __future__ import with_statement - -import openerp -from openerp.osv import fields, osv -from openerp import tools -from openerp.modules.module import get_module_resource -from openerp.tools.translate import _ -from openerp.report.render import render -from openerp.report.interface import report_int -import tempfile -import os - -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=None): - - registry = openerp.registry(cr.dbname) - taxobj = registry['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']}): - if str(t.code): - result['case_'+str(t.code)] = '%.2f' % (t.sum_period or 0.0, ) - user = registry['res.users'].browse(cr, uid, uid, context) - - # Not Clean, to be changed - partner = user.company_id.partner_id - result['info_name'] = user.company_id.name - result['info_vatnum'] = partner.vat - if partner: - result['info_address'] = partner.street - result['info_address2'] = (partner.zip or '') + ' ' + (partner.city or '') - try: - tmp_file = tempfile.mkstemp(".pdf")[1] - try: - tools.pdf_utils.fill_pdf(get_module_resource('l10n_lu','wizard', '2008_DECL_F_M10.pdf'), tmp_file, result) - with open(tmp_file, "r") as ofile: - self.obj = external_pdf(ofile.read()) - finally: - try: - os.remove(tmp_file) - except: - pass # nothing to do - self.obj.render() - return (self.obj.pdf, 'pdf') - except Exception: - raise osv.except_osv(_('PDF Not Created!'), _('Please check if package pdftk is installed!')) - -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', readonly=False, required=True, domain=[('parent_id','=',False)]), - 'type': fields.selection([('monthly','Monthly'),('quarterly','Quaterly'),('yearly','Yearly')], 'Type', required=True), - 'period_id' : fields.many2one('account.period', 'From Period', required=True), - 'to_period_id': fields.many2one('account.period', 'To Period', required=True), - } - - _defaults = { - 'type': 'monthly', - } - - def print_vat_declaration_report(self, cr, uid, ids, context=None): - active_ids = context.get('active_ids',[]) - data = {} - data['form'] = {} - data['ids'] = active_ids - data['form']['tax_code_id'] = self.browse(cr, uid, ids)[0].tax_code_id.id - data['form']['period_id'] = self.browse(cr, uid, ids)[0].period_id.id - return { 'type': 'ir.actions.report.xml', 'report_name': 'l10n_lu.tax.report.print', 'datas': data} - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_lu/wizard/print_vat_view.xml b/addons/l10n_lu/wizard/print_vat_view.xml deleted file mode 100644 index 61a29378163..00000000000 --- a/addons/l10n_lu/wizard/print_vat_view.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - VAT Declaration Report - vat.declaration.report - -
- - - - - - -
-
-
-
-
- - - VAT Declaration Report - ir.actions.act_window - vat.declaration.report - form - form - - new - - - - - -
- -