account_fiscal_year_closing/fyc_view.xml
<?xml version="1.0" encoding="utf-8"?>
<!--
#
# OpenERP - Spanish Fiscal Year Closing
# Copyright (C) 2009 Pexego Sistemas Informáticos. All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-->
<!--
Authors: Borja López Soilán (Pexego) - borja@kami.es
-->
<openerp>
<data>
<!-- Wizard tree view -->
<record model="ir.ui.view" id="view_fyc_tree">
<field name="name">account_fiscal_year_closing.fyc.tree</field>
<field name="model">account_fiscal_year_closing.fyc</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Fiscal Year Closings" colors="red:state=='new';blue:state=='draft';green:state=='in_progress'">
<field name="company_id" select="1"/>
<field name="name" select="2"/>
<field name="closing_fiscalyear_id" select="1"/>
<field name="opening_fiscalyear_id" select="1"/>
<field name="state"/>
</tree>
</field>
</record>
<!-- Wizard form view -->
<record model="ir.ui.view" id="view_fyc_form">
<field name="name">account_fiscal_year_closing.fyc.form</field>
<field name="model">account_fiscal_year_closing.fyc</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Fiscal Year Closing">
<group attrs="{'invisible':[('state','!=','new')]}" colspan="4">
<label string="Please, select the company, fiscal year to close and fiscal year to open." colspan="4"/>
</group>
<group colspan="4">
<field name="company_id" required="1" select="1" attrs="{'readonly':[('state','!=','new')]}"/>
<field name="name" select="2" attrs="{'readonly':[('state','!=','new')]}"/>
</group>
<group string="Fiscal Years" colspan="4">
<field name="closing_fiscalyear_id" attrs="{'readonly':[('state','!=','new')]}"/>
<field name="opening_fiscalyear_id" attrs="{'readonly':[('state','!=','new')]}"/>
</group>
<group attrs="{'invisible':[('state','!=','new')]}" colspan="4">
<button name="draft" string="Continue" states="new" icon="gtk-apply" colspan="4"/>
</group>
<group attrs="{'invisible':[('state','=','new')]}" colspan="4">
<notebook colspan="4">
<page string="General">
<group string="Operations" colspan="4">
<group colspan="4">
<separator string="Operation to perform" colspan="2"/>
<separator string="Move created by the operation" colspan="2"/>
<field name="create_loss_and_profit" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="loss_and_profit_move_id"/>
<field name="create_net_loss_and_profit" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="net_loss_and_profit_move_id"/>
<field name="create_closing" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="closing_move_id"/>
<field name="create_opening" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="opening_move_id"/>
</group>
<separator string="Checks"/>
<group colspan="4">
<field name="check_invalid_period_moves" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="check_draft_moves" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="check_unbalanced_moves" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
</group>
</group>
<group colspan="4" col="10">
<field name="state" select="2" readonly="1"/>
<button name="%(fyc_run_action)d"
type="action"
string="Perform the operations"
icon="gtk-execute"
states="draft,in_progress"/>
<button name="confirm" string="Confirm" states="in_progress" icon="gtk-apply"/>
<button name="cancel"
string="Cancel"
icon="gtk-cancel"
states="in_progress,done"/>
<button name="action_recover" string="Draft" type="object" states="canceled" icon="gtk-undo"/>
</group>
</page>
<page string="Configuration" attrs="{'invisible':[('state','=','new')]}">
<notebook colspan="4">
<page string="Loss and Profit">
<field name="lp_description" colspan="4" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="lp_journal_id" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="lp_period_id" domain="[('special','=',True)]" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="lp_date" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="lp_account_mapping_ids" colspan="4" nolabel="1" attrs="{'readonly':[('state','in',('done','cancel'))]}">
<tree string="Account mappings" editable="top">
<field name="source_account_id"/>
<field name="dest_account_id" required="1"/>
</tree>
<form string="Account mapping">
<field name="source_account_id"/>
<field name="dest_account_id" required="1"/>
<field name="name"/>
</form>
</field>
</page>
<page string="Net Loss and Profit">
<field name="nlp_description" colspan="4" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="nlp_journal_id" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="nlp_period_id" domain="[('special','=',True)]" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="nlp_date" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="nlp_account_mapping_ids" colspan="4" nolabel="1" attrs="{'readonly':[('state','in',('done','cancel'))]}">
<tree string="Account mappings" editable="top">
<field name="source_account_id"/>
<field name="dest_account_id"/>
</tree>
<form string="Account mapping">
<field name="source_account_id"/>
<field name="dest_account_id"/>
<field name="name"/>
</form>
</field>
</page>
<page string="Closing">
<field name="c_description" colspan="4" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="c_journal_id" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="c_period_id" domain="[('special','=',True)]" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="c_date" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="c_account_mapping_ids" colspan="4" nolabel="1" attrs="{'readonly':[('state','in',('done','cancel'))]}">
<tree string="Accounts to close" editable="top">
<field name="source_account_id"/>
</tree>
<form string="Account to close">
<field name="source_account_id"/>
<field name="name"/>
</form>
</field>
</page>
<page string="Opening">
<field name="o_description" colspan="4" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="o_journal_id" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="o_period_id" domain="[('special','=',True)]" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
<field name="o_date" attrs="{'readonly':[('state','in',('done','cancel'))]}"/>
</page>
</notebook>
</page>
</notebook>
</group>
</form>
</field>
</record>
<!-- Menus and windows -->
<record model="ir.actions.act_window" id="action_view_fyc_form">
<field name="name">Close Fiscal Year</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account_fiscal_year_closing.fyc</field>
<field name="view_type">form</field>
<field name="view_mode">form,tree</field>
<field name="view_id" ref="view_fyc_form"/>
</record>
<menuitem id="menu_fyc_new"
parent="account.menu_account_end_year_treatments"
name="Close Fiscal Year"
action="action_view_fyc_form"
sequence="10"/>
<record model="ir.actions.act_window" id="action_view_fyc_tree">
<field name="name">Fiscal Years Closings</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account_fiscal_year_closing.fyc</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_fyc_tree"/>
</record>
<menuitem id="menu_fyc_list"
parent="account.menu_account_end_year_treatments"
name="Fiscal Years Closings"
action="action_view_fyc_tree"
sequence="11"/>
</data>
</openerp>