mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[FIX] coding standards
This commit is contained in:
@@ -17,5 +17,5 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
import account_tax_analysis
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
from . import account_tax_analysis
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -17,21 +17,28 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
{
|
||||
"name" : "Tax analysis",
|
||||
"version" : "1.0",
|
||||
"depends" : ["base", "account"],
|
||||
"author" : "CamptoCamp SA",
|
||||
"category": 'Accounting & Finance',
|
||||
"description": """Provide with details of your tax form (Allows you to group by move lines by tax account)
|
||||
""",
|
||||
'website': 'http://www.openerp.com',
|
||||
'init_xml': [],
|
||||
'update_xml': [
|
||||
'account_tax_analysis_view.xml',
|
||||
],
|
||||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
}
|
||||
{"name": "Tax analysis",
|
||||
"version": "1.0",
|
||||
"depends": ["base", "account"],
|
||||
"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",
|
||||
"init_xml": [],
|
||||
"update_xml": ["account_tax_analysis_view.xml"],
|
||||
"demo_xml": [],
|
||||
"installable": True,
|
||||
"active": False,
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -17,35 +17,40 @@
|
||||
# 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', required=True),
|
||||
'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),
|
||||
'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')
|
||||
mod_obj = self.pool.get('ir.model.data')
|
||||
action_obj = self.pool.get('ir.actions.act_window')
|
||||
domain = []
|
||||
data = self.read(cr, uid, ids, [])[0]
|
||||
period_list = data['period_list']
|
||||
if period_list :
|
||||
domain = [('period_id','in',period_list)]
|
||||
if period_list:
|
||||
domain = [('period_id', 'in', period_list)]
|
||||
else:
|
||||
raise osv.except_osv(_('No period defined'),_("You must selected period "))
|
||||
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')
|
||||
actions = mod_obj.get_object_reference(cr, uid,
|
||||
'account_tax_analysis', 'action_view_tax_analysis')
|
||||
id_action = actions and actions[1] or False
|
||||
action_mod = action_obj.read(cr,uid,id_action)
|
||||
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:
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -1,106 +1,121 @@
|
||||
<openerp>
|
||||
<data>
|
||||
<data>
|
||||
<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>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-document-new"
|
||||
string="Unposted"
|
||||
domain="[('move_id.state','=','draft')]"
|
||||
help="Unposted Journal Items"/>
|
||||
<filter name="posted"
|
||||
icon="terp-camera_test"
|
||||
string="Posted"
|
||||
domain="[('move_id.state','=','posted')]"
|
||||
help="Posted Journal Items"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date"/>
|
||||
<field name="account_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By...">
|
||||
<filter string="Partner" icon="terp-partner"
|
||||
domain="[]"
|
||||
context="{'group_by': 'partner_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Account"
|
||||
icon="terp-folder-green"
|
||||
context="{'group_by': 'account_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Period"
|
||||
icon="terp-go-month"
|
||||
domain="[]"
|
||||
context="{'group_by': 'period_id'}"/>
|
||||
<filter string="Tax account"
|
||||
icon="terp-go-month"
|
||||
domain="[]"
|
||||
context="{'group_by': 'tax_code_id'}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<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">
|
||||
<field name="tax_code_id" />
|
||||
<field name="name"/>
|
||||
<field name="ref"/>
|
||||
<field name="period_id"/>
|
||||
<field name="date"/>
|
||||
<field name="partner_id" />
|
||||
<field name="account_id" domain="[('journal_id','=',journal_id), ('company_id', '=', company_id)]"/>
|
||||
<field name="debit" sum="Total debit"/>
|
||||
<field name="credit" sum="Total credit"/>
|
||||
<field name="tax_amount" sum="Total Taxe"/>
|
||||
<field name="amount_currency" />
|
||||
<field name="currency_id" />
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<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>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-document-new" string="Unposted" domain="[('move_id.state','=','draft')]" help="Unposted Journal Items"/>
|
||||
<filter name="posted" icon="terp-camera_test" string="Posted" domain="[('move_id.state','=','posted')]" help="Posted Journal Items"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="date"/>
|
||||
<field name="account_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By...">
|
||||
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Account" icon="terp-folder-green" context="{'group_by':'account_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Period" icon="terp-go-month" domain="[]" context="{'group_by':'period_id'}"/>
|
||||
<filter string="Tax account" icon="terp-go-month" domain="[]" context="{'group_by':'tax_code_id'}"/>
|
||||
</group>
|
||||
<newline/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_view_tax_analysis" model="ir.actions.act_window">
|
||||
<field name="name">Recurring Models</field>
|
||||
<field name="res_model">account.move.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="search_view_id" ref="view_account_move_line_filter_vat_analysis"/>
|
||||
<field name="view_id" ref="view_move_line_tree_tax_analysis"/>
|
||||
</record>
|
||||
|
||||
<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">
|
||||
<field name="tax_code_id" />
|
||||
<field name="name"/>
|
||||
<field name="ref"/>
|
||||
<field name="period_id"/>
|
||||
<field name="date"/>
|
||||
<field name="partner_id" />
|
||||
<field name="account_id" domain="[('journal_id','=',journal_id), ('company_id', '=', company_id)]"/>
|
||||
<field name="debit" sum="Total debit"/>
|
||||
<field name="credit" sum="Total credit"/>
|
||||
<field name="tax_amount" sum="Total Taxe"/>
|
||||
<field name="amount_currency" />
|
||||
<field name="currency_id" />
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<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>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_vat_declaration_analysis" model="ir.actions.act_window">
|
||||
<field name="name">Account Vat Declaration</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">account.vat.declaration.analysis</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
<field name="help">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. That’s 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.</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_tax_analysis" model="ir.actions.act_window">
|
||||
<field name="name">Recurring Models</field>
|
||||
<field name="res_model">account.move.line</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="search_view_id" ref="view_account_move_line_filter_vat_analysis"/>
|
||||
<field name="view_id" ref="view_move_line_tree_tax_analysis"/>
|
||||
</record>
|
||||
<menuitem
|
||||
name="Taxes Analysis"
|
||||
parent="account.menu_tax_report"
|
||||
action="action_account_vat_declaration_analysis"
|
||||
id="menu_account_vat_declaration_analysis"
|
||||
icon="STOCK_PRINT"/>
|
||||
|
||||
<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>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_account_vat_declaration_analysis" model="ir.actions.act_window">
|
||||
<field name="name">Account Vat Declaration</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">account.vat.declaration.analysis</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
<field name="help">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. That’s 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.</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Taxes Analysis"
|
||||
parent="account.menu_tax_report"
|
||||
action="action_account_vat_declaration_analysis"
|
||||
id="menu_account_vat_declaration_analysis"
|
||||
icon="STOCK_PRINT"/>
|
||||
</data>
|
||||
|
||||
</openerp>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user