diff --git a/__unported__/account_tax_analysis/account_tax_analysis.py b/__unported__/account_tax_analysis/account_tax_analysis.py deleted file mode 100644 index a8a05b679..000000000 --- a/__unported__/account_tax_analysis/account_tax_analysis.py +++ /dev/null @@ -1,57 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author Vincent Renaville. Copyright 2013 Camptocamp SA -# -# 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 . -# -############################################################################## -from osv import orm, osv, fields -from tools.translate import _ - - -class account_tax_declaration_analysis(orm.TransientModel): - _name = 'account.vat.declaration.analysis' - _description = 'Account Vat Declaration' - _columns = { - 'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscalyear', - help='Fiscalyear to look on', - required=True), - - 'period_list': fields.many2many('account.period', - 'account_tax_period_rel', - 'tax_analysis', 'period_id', - 'Period _list', required=True), - } - - def create_vat(self, cr, uid, ids, context=None): - mod_obj = self.pool.get('ir.model.data') - action_obj = self.pool.get('ir.actions.act_window') - domain = [] - data = self.read(cr, uid, ids, [], context=context)[0] - period_list = data['period_list'] - if period_list: - domain = [('period_id', 'in', period_list)] - else: - raise osv.except_osv(_('No period defined'), - _("You must selected period ")) - actions = mod_obj.get_object_reference(cr, uid, - 'account_tax_analysis', - 'action_view_tax_analysis') - id_action = actions[1] if actions else False - action_mod = action_obj.read(cr, uid, id_action) - action_mod['domain'] = domain - return action_mod - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/account_tax_analysis/README.rst b/account_tax_analysis/README.rst new file mode 100644 index 000000000..c0a8941c6 --- /dev/null +++ b/account_tax_analysis/README.rst @@ -0,0 +1,16 @@ +Tax analysis view +================= + +This add-on is a must if you want to be able to validate your VAT form. + +Thanks to a new menu 'Invoicing / Reporting / Generic Reporting / Taxes / Taxes Analysis' +you are able to group accounting entries by Taxes (VAT codes) +and/or financial accounts. + +This way you will find easily differences you may see between +the OpenERP tax report and what you see in your books. + +Contributors +============ + + * Vincent Renaville (Camptocamp SA) diff --git a/__unported__/account_tax_analysis/__init__.py b/account_tax_analysis/__init__.py similarity index 100% rename from __unported__/account_tax_analysis/__init__.py rename to account_tax_analysis/__init__.py diff --git a/__unported__/account_tax_analysis/__openerp__.py b/account_tax_analysis/__openerp__.py similarity index 69% rename from __unported__/account_tax_analysis/__openerp__.py rename to account_tax_analysis/__openerp__.py index 5dfea9c03..29ffaa9de 100644 --- a/__unported__/account_tax_analysis/__openerp__.py +++ b/account_tax_analysis/__openerp__.py @@ -20,23 +20,10 @@ {"name": "Tax analysis", "version": "1.0", "depends": ["base", "account"], - "author": "CamptoCamp SA", + "author": "Camptocamp SA", "category": 'Accounting & Finance', - "description": """ -Tax analysis view -================= - -This add-on is a must if you want to be able to validate your VAT form. - -Thanks to a new menu 'Accounting / Tax / Tax analysis' -you are able to group accounting entries by Taxes (VAT codes) -and/or financial accounts. - -This way you will find easily differences you may see between -the OpenERP tax report and what you see in your books.""", "website": "http://www.camptocamp.com", "data": ["account_tax_analysis_view.xml"], - 'installable': False, + 'installable': True, "active": False, } -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/account_tax_analysis/account_tax_analysis.py b/account_tax_analysis/account_tax_analysis.py new file mode 100644 index 000000000..0bcc26b2a --- /dev/null +++ b/account_tax_analysis/account_tax_analysis.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author Vincent Renaville. Copyright 2013-2014 Camptocamp SA +# +# 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 . +# +############################################################################## +from openerp import models, fields, api + + +class AccountTaxDeclarationAnalysis(models.TransientModel): + _name = 'account.vat.declaration.analysis' + _description = 'Account Vat Declaration' + + fiscalyear_id = fields.Many2one( + comodel_name='account.fiscalyear', + string='Fiscalyear', + help='Fiscalyear to look on', + required=True, + ) + + period_list = fields.Many2many( + comodel_name='account.period', + relation='account_tax_period_rel', + column1='tax_analysis', + column2='period_id', + string='Periods', + help="If no period is selected, all the periods of the " + "fiscal year will be used", + ) + + @api.multi + def show_vat(self): + periods = self.period_list + if not periods: + periods = self.fiscalyear_id.period_ids + domain = [('period_id', 'in', periods.ids)] + action = self.env.ref('account_tax_analysis.action_view_tax_analysis') + action_fields = action.read()[0] + action_fields['domain'] = domain + return action_fields diff --git a/__unported__/account_tax_analysis/account_tax_analysis_view.xml b/account_tax_analysis/account_tax_analysis_view.xml similarity index 91% rename from __unported__/account_tax_analysis/account_tax_analysis_view.xml rename to account_tax_analysis/account_tax_analysis_view.xml index 53f2f8dc8..a4b464f48 100644 --- a/__unported__/account_tax_analysis/account_tax_analysis_view.xml +++ b/account_tax_analysis/account_tax_analysis_view.xml @@ -3,11 +3,10 @@ Journal Items Tax account.move.line - search - + account.move.line.tree account.move.line - tree @@ -73,7 +71,7 @@ - Recurring Models + Taxes Analysis account.move.line form tree @@ -84,18 +82,17 @@ Account Vat Declaration account.vat.declaration.analysis - form
- - -