Merge pull request #75 from guewen/8.0-account_tax_analysis-migr

8.0: Migration of account_tax_analysis
This commit is contained in:
Leonardo Pistone
2014-12-05 16:04:25 +01:00
8 changed files with 172 additions and 161 deletions

View File

@@ -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 <http://www.gnu.org/licenses/>.
#
##############################################################################
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:

View File

@@ -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)

View File

@@ -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:

View File

@@ -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 <http://www.gnu.org/licenses/>.
#
##############################################################################
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

View File

@@ -3,11 +3,10 @@
<record id="view_account_move_line_filter_vat_analysis" model="ir.ui.view">
<field name="name">Journal Items Tax</field>
<field name="model">account.move.line</field>
<field name="type">search</field>
<field eval="32" name="priority"/>
<field name="arch" type="xml">
<search string="Search Journal Items">
<group>
<group string="Filters">
<separator orientation="vertical"/>
<filter icon="terp-document-new"
string="Unposted"
@@ -50,7 +49,6 @@
<record id="view_move_line_tree_tax_analysis" model="ir.ui.view">
<field name="name">account.move.line.tree</field>
<field name="model">account.move.line</field>
<field name="type">tree</field>
<field eval="16" name="priority"/>
<field name="arch" type="xml">
<tree string="Journal Items" editable="top" on_write="on_create_write">
@@ -73,7 +71,7 @@
<record id="action_view_tax_analysis" model="ir.actions.act_window">
<field name="name">Recurring Models</field>
<field name="name">Taxes Analysis</field>
<field name="res_model">account.move.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
@@ -84,18 +82,17 @@
<record id="view_account_vat_declaration_analysis" model="ir.ui.view">
<field name="name">Account Vat Declaration</field>
<field name="model">account.vat.declaration.analysis</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Taxes Report">
<separator string="Taxes Report" colspan="4"/>
<newline/>
<field name="fiscalyear_id"/>
<separator string="Periods" colspan="4"/>
<field name="period_list" domain="[('fiscalyear_id', '=', fiscalyear_id)]"/>
<group col="2" colspan="4">
<button icon='gtk-cancel' special="cancel" string="Cancel" />
<button name="create_vat" string="Show tax lines" colspan="1" type="object" icon="gtk-ok"/>
</group>
<footer>
<button name="show_vat" string="Show tax lines" type="object" class="oe_highlight"/>
or
<button special="cancel" string="Cancel" class="oe_link"/>
</footer>
</form>
</field>
</record>

View File

@@ -1,13 +1,13 @@
# Translation of OpenERP Server.
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_tax_analysis
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-10-18 17:51+0000\n"
"PO-Revision-Date: 2013-10-18 17:51+0000\n"
"POT-Creation-Date: 2014-11-19 09:13+0000\n"
"PO-Revision-Date: 2014-11-19 09:13+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -15,6 +15,11 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: account_tax_analysis
#: view:account.move.line:account_tax_analysis.view_account_move_line_filter_vat_analysis
msgid "Account"
msgstr ""
#. module: account_tax_analysis
#: model:ir.actions.act_window,name:account_tax_analysis.action_account_vat_declaration_analysis
#: model:ir.model,name:account_tax_analysis.model_account_vat_declaration_analysis
@@ -22,18 +27,23 @@ msgid "Account Vat Declaration"
msgstr ""
#. module: account_tax_analysis
#: field:account.vat.declaration.analysis,period_list:0
msgid "Period _list"
#: view:account.vat.declaration.analysis:account_tax_analysis.view_account_vat_declaration_analysis
msgid "Cancel"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:0
msgid "Group By..."
#: field:account.vat.declaration.analysis,create_uid:0
msgid "Created by"
msgstr ""
#. module: account_tax_analysis
#: help:account.vat.declaration.analysis,fiscalyear_id:0
msgid "Fiscalyear to look on"
#: field:account.vat.declaration.analysis,create_date:0
msgid "Created on"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:account_tax_analysis.view_account_move_line_filter_vat_analysis
msgid "Filters"
msgstr ""
#. module: account_tax_analysis
@@ -42,114 +52,119 @@ msgid "Fiscalyear"
msgstr ""
#. module: account_tax_analysis
#: model:ir.actions.act_window,help:account_tax_analysis.action_account_vat_declaration_analysis
msgid "This menu print a VAT declaration based on invoices or payments. You can select one or several periods of the fiscal year. Information required for a tax declaration is automatically generated by OpenERP from invoices (or payments, in some countries). This data is updated in real time. Thats very useful because it enables you to preview at any time the tax that you owe at the start and end of the month or quarter."
#: help:account.vat.declaration.analysis,fiscalyear_id:0
msgid "Fiscalyear to look on"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:0
msgid "Unposted"
#: view:account.move.line:account_tax_analysis.view_account_move_line_filter_vat_analysis
msgid "Group By..."
msgstr ""
#. module: account_tax_analysis
#: model:ir.actions.act_window,name:account_tax_analysis.action_view_tax_analysis
msgid "Recurring Models"
#: field:account.vat.declaration.analysis,id:0
msgid "ID"
msgstr ""
#. module: account_tax_analysis
#: view:account.vat.declaration.analysis:0
msgid "Taxes Report"
#: help:account.vat.declaration.analysis,period_list:0
msgid "If no period is selected, all the periods of the fiscal year will be used"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:0
msgid "Unposted Journal Items"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:0
#: view:account.move.line:account_tax_analysis.view_move_line_tree_tax_analysis
msgid "Journal Items"
msgstr ""
#. module: account_tax_analysis
#: field:account.vat.declaration.analysis,write_uid:0
msgid "Last Updated by"
msgstr ""
#. module: account_tax_analysis
#: field:account.vat.declaration.analysis,write_date:0
msgid "Last Updated on"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:account_tax_analysis.view_account_move_line_filter_vat_analysis
msgid "Partner"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:account_tax_analysis.view_account_move_line_filter_vat_analysis
msgid "Period"
msgstr ""
#. module: account_tax_analysis
#: view:account.vat.declaration.analysis:account_tax_analysis.view_account_vat_declaration_analysis
#: field:account.vat.declaration.analysis,period_list:0
msgid "Periods"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:account_tax_analysis.view_account_move_line_filter_vat_analysis
msgid "Posted"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:account_tax_analysis.view_account_move_line_filter_vat_analysis
msgid "Posted Journal Items"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:account_tax_analysis.view_account_move_line_filter_vat_analysis
msgid "Search Journal Items"
msgstr ""
#. module: account_tax_analysis
#: view:account.vat.declaration.analysis:account_tax_analysis.view_account_vat_declaration_analysis
msgid "Show tax lines"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:account_tax_analysis.view_account_move_line_filter_vat_analysis
msgid "Tax account"
msgstr ""
#. module: account_tax_analysis
#: model:ir.actions.act_window,name:account_tax_analysis.action_view_tax_analysis
#: model:ir.ui.menu,name:account_tax_analysis.menu_account_vat_declaration_analysis
msgid "Taxes Analysis"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:0
msgid "Tax account"
#: view:account.vat.declaration.analysis:account_tax_analysis.view_account_vat_declaration_analysis
msgid "Taxes Report"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:0
msgid "Posted"
#: model:ir.actions.act_window,help:account_tax_analysis.action_account_vat_declaration_analysis
msgid "This menu print a VAT declaration based on invoices or payments. You can select one or several periods of the fiscal year. Information required for a tax declaration is automatically generated by OpenERP from invoices (or payments, in some countries). This data is updated in real time. Thats very useful because it enables you to preview at any time the tax that you owe at the start and end of the month or quarter."
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:0
msgid "Account"
msgstr ""
#. module: account_tax_analysis
#: code:addons/account_tax_analysis/account_tax_analysis.py:45
#, python-format
msgid "No period defined"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:0
msgid "Search Journal Items"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:0
msgid "Total credit"
msgstr ""
#. module: account_tax_analysis
#: view:account.vat.declaration.analysis:0
msgid "Show tax lines"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:0
msgid "Period"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:0
msgid "Total debit"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:0
#: view:account.move.line:account_tax_analysis.view_move_line_tree_tax_analysis
msgid "Total Taxe"
msgstr ""
#. module: account_tax_analysis
#: view:account.vat.declaration.analysis:0
msgid "Periods"
#: view:account.move.line:account_tax_analysis.view_move_line_tree_tax_analysis
msgid "Total credit"
msgstr ""
#. module: account_tax_analysis
#: view:account.vat.declaration.analysis:0
msgid "Cancel"
#: view:account.move.line:account_tax_analysis.view_move_line_tree_tax_analysis
msgid "Total debit"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:0
msgid "Partner"
#: view:account.move.line:account_tax_analysis.view_account_move_line_filter_vat_analysis
msgid "Unposted"
msgstr ""
#. module: account_tax_analysis
#: view:account.move.line:0
msgid "Posted Journal Items"
msgstr ""
#. module: account_tax_analysis
#: code:addons/account_tax_analysis/account_tax_analysis.py:46
#, python-format
msgid "You must selected period "
#: view:account.move.line:account_tax_analysis.view_account_move_line_filter_vat_analysis
msgid "Unposted Journal Items"
msgstr ""