[IMP] Invoicing App misc useability improvements
[odoo/odoo.git] / addons / account / account_view.xml
index eddb7cc..36a87cc 100644 (file)
@@ -44,7 +44,7 @@
             <field name="model">account.fiscalyear</field>
             <field name="type">tree</field>
             <field name="arch" type="xml">
-                <tree colors="blue:state in ('draft');gray:state in ('done') " string="Fiscalyear">
+                <tree colors="blue:state == 'draft';gray:state == 'done' " string="Fiscalyear">
                     <field name="code"/>
                     <field name="name"/>
                     <field name="company_id" groups="base.group_multi_company"/>
             <field name="model">account.period</field>
             <field name="type">tree</field>
             <field name="arch" type="xml">
-              <tree colors="blue:state in ('draft');gray:state in ('done') " string="Period">
+              <tree colors="blue:state == 'draft';gray:state == 'done' " string="Period">
                     <field name="name"/>
                     <field name="code"/>
                     <field name="date_start"/>
             <field name="arch" type="xml">
                 <form string="Account">
                     <group col="6" colspan="4">
-                    <field name="name" select="1"/>
-                    <field name="code" select="1"/>
-                    <field name="company_id" widget="selection" groups="base.group_multi_company"/>
-                    <newline/>
-                    <field name="parent_id"/>
-                    <field name="type" select="1"/>
-                    <field name="user_type" select="1"/>
+                        <field name="name" select="1"/>
+                        <field name="code" select="1"/>
+                        <field name="company_id" widget="selection" groups="base.group_multi_company"/>
+                        <newline/>
+                        <field name="parent_id"/>
+                        <field name="type" select="1"/>
+                        <field name="user_type" select="1"/>
+                        <field name="active" groups="base.group_extended" />
+                        <newline/>
+                        <field name="debit" invisible="context.get('config_invisible', True)" attrs="{'readonly':[('type','=','view')]}"/>
+                        <field name="credit" invisible="context.get('config_invisible', True)" attrs="{'readonly':[('type','=','view')]}"/>
+                        <field name="balance" invisible="context.get('config_invisible', True)"/>
                     </group>
                     <notebook colspan="4">
                         <page string="General Information">
-                            <field name="active" groups="base.group_extended" />
                             <newline/>
                             <group col="2" colspan="2">
                                 <separator string="Currency" colspan="2"/>
             <field name="type">search</field>
             <field name="arch" type="xml">
                 <search string="Accounts">
-                    <group col="10" colspan="4">
+                    <group>
                         <filter icon="terp-sale" string="Receivable Accounts" domain="[('type','=','receivable')]"/>
                         <filter icon="terp-purchase" string="Payable Accounts" domain="[('type','=','payable')]"/>
                         <separator orientation="vertical"/>
                         <field name="code"/>
                         <field name="name"/>
                         <field name="user_type"/>
-                        <field name="type"/>
                     </group>
                     <newline/>
                     <group expand="0" string="Group By...">
             <field name="type">tree</field>
             <field name="field_parent">child_id</field>
             <field name="arch" type="xml">
-                <tree colors="blue:type in ('view');black:type in ('other','receivable','payable','consolidation');gray:type in ('closed')" string="Chart of accounts" toolbar="1" >
+                <tree colors="blue:type == 'view';black:type in ('other','receivable','payable','consolidation');gray:type == 'closed'" string="Chart of accounts" toolbar="1" >
                     <field name="code"/>
                     <field name="name"/>
                     <field name="parent_id" invisible="1"/>
             <field name="type">tree</field>
             <field name="field_parent">child_id</field>
             <field name="arch" type="xml">
-                <tree colors="blue:type in ('view');black:type in ('other','receivable','payable','consolidation');gray:type in ('closed')" string="Chart of accounts" toolbar="1" >
+                <tree colors="blue:type == 'view';black:type in ('other','receivable','payable','consolidation');gray:type == 'closed'" string="Chart of accounts" toolbar="1" >
                     <field name="code"/>
                     <field name="name"/>
                     <field name="debit"/>
             <field name="domain">[('parent_id','=',False)]</field>
         </record>
 
+         <record id="view_account_gain_loss_tree" model="ir.ui.view">
+           <field name="name">Unrealized Gain or Loss</field>
+            <field name="model">account.account</field>
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <tree string="Unrealized Gains and losses">
+                    <field name="code"/>
+                    <field name="name"/>
+                    <field name="currency_id"/>
+                    <field name="exchange_rate"/>
+                    <field name="foreign_balance"/>
+                    <field name="adjusted_balance"/>
+                    <field name="balance"/>
+                    <field name="unrealized_gain_loss"/>
+                </tree>
+            </field>
+        </record>
+
+          <record id="action_account_gain_loss" model="ir.actions.act_window">
+            <field name="name">Unrealized Gain or Loss</field>
+            <field name="res_model">account.account</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree</field>
+            <field name="view_id" ref="view_account_gain_loss_tree"/>
+            <field name="domain">[('currency_id','!=',False)]</field>
+            <field name="help">When doing multi-currency transactions, you may loose or gain some amount due to changes of exchange rate. This menu gives you a forecast of the Gain or Loss you'd realized if those transactions were ended today. Only for accounts having a secondary currency set.</field>
+        </record>
+
+        <menuitem
+            name="Unrealized Gain or Loss"
+            action="action_account_gain_loss"
+            groups="account.group_account_user"
+            id="menu_unrealized_gains_losses"
+            parent="account.menu_multi_currency"/>
+
         <!--
         Journal
 
             <field name="help">Here you can customize an existing journal view or create a new view. Journal views determine the way you can record entries in your journal. Select the fields you want to appear in a journal and determine the sequence in which they will appear. Then you can create a new journal and link your view to it.</field>
         </record>
 
-        <menuitem action="action_account_journal_view" id="menu_action_account_journal_view" parent="account.menu_journals"/>
+        <menuitem action="action_account_journal_view" id="menu_action_account_journal_view" parent="account.menu_journals" sequence="20"  groups="base.group_extended"/>
 
         <!--
     # Account Journal
             <field name="model">account.journal</field>
             <field name="type">search</field>
             <field name="arch" type="xml">
-                <tree string="Search Account Journal">
+                <search string="Search Account Journal">
                     <group>
                     <filter domain="['|', ('type', '=', 'sale'), ('type', '=', 'sale_refund')]" string="Sale" icon="terp-camera_test"/>
                     <filter domain="['|', ('type', '=', 'purchase'), ('type', '=', 'purchase_refund')]" string="Purchase" icon="terp-purchase"/>
                     <separator orientation="vertical"/>
                     <filter string="Type" context="{'group_by':'type'}" icon="terp-stock_symbol-selection"/>
                     </group>
-                </tree>
+                </search>
             </field>
         </record>
         <record id="view_account_journal_form" model="ir.ui.view">
                                 <field name="user_id" groups="base.group_extended"/>
                                 <field name="currency"/>
                             </group>
-                            <group colspan="2" col="2">
+                            <group colspan="2" col="2" groups="base.group_extended">
                                 <separator string="Validations" colspan="4"/>
-                                <field name="allow_date" groups="base.group_extended"/>
+                                <field name="allow_date"/>
                             </group>
                             <group colspan="2" col="2">
                                 <separator string="Other Configuration" colspan="4"/>
 <!--                                <field name="invoice_sequence_id"/>-->
                                 <field name="group_invoice_lines"/>
                             </group>
-                            <group colspan="2" col="2" groups="base.group_extended">
+                            <group colspan="2" col="2"> <!-- can't set the field as hidden for certain groups as it's required in the object and not in the view, and GTK doesn't handle that correctly -->
                                 <separator string="Sequence" colspan="4"/>
-                                <field name="sequence_id"/>
+                                <field name="sequence_id" required="0"/>
                             </group>
                         </page>
                         <page string="Entry Controls" groups="base.group_extended">
             <field name="type">search</field>
             <field name="arch" type="xml">
                 <search string="Search Bank Statements">
-                    <group col="8" colspan="4">
+                    <group>
                         <filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
                         <filter string="Confirmed" domain="[('state','=','confirm')]" icon="terp-camera_test"/>
                         <separator orientation="vertical"/>
             <field name="type">search</field>
             <field name="arch" type="xml">
                 <search string="Search Bank Statements">
-                    <group col="8" colspan="4">
+                    <group>
                         <filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
                         <filter string="Confirmed" domain="[('state','=','confirm')]" icon="terp-camera_test"/>
                         <separator orientation="vertical"/>
                     </group>
                     <notebook colspan="4">
                         <page string="Transaction" name="statement_line_ids">
-                            <field colspan="4" name="line_ids" nolabel="1">
+                            <field colspan="4" name="line_ids" nolabel="1" context="{'date':date}">
                                 <tree editable="bottom" string="Statement lines">
                                     <field name="sequence" readonly="1" invisible="1"/>
                                     <field name="date" groups="base.group_extended"/>
                         </page>
                     </notebook>
                     <group col="8" colspan="4">
-                        <field name="state"/>
+                        <field name="state" widget="statusbar" statusbar_visible="draft,confirm"/>
                         <field name="balance_end"/>
                         <button name="button_cancel" states="confirm" string="Cancel" type="object" icon="gtk-cancel"/>
                         <button name="button_dummy" states="draft" string="Compute" type="object" icon="terp-stock_format-scientific"/>
                     <group col="2" colspan="2">
                         <separator string="Reporting Configuration" colspan="4"/>
                         <field name="report_type" select="2"/>
+                        <field name="sign" />                        
                     </group>
                     <group col="2" colspan="2">
                         <separator string="Closing Method" colspan="4"/>
             <field name="search_view_id" ref="view_account_type_search"/>
             <field name="help">An account type is used to determine how an account is used in each journal. The deferral method of an account type determines the process for the annual closing. Reports such as the Balance Sheet and the Profit and Loss report use the category (profit/loss or balance sheet). For example, the account type could be linked to an asset account, expense account or payable account. From this view, you can create and manage the account types you need for your company.</field>
         </record>
-        <menuitem action="action_account_type_form" sequence="6" id="menu_action_account_type_form" parent="account_account_menu"/>
+        <menuitem action="action_account_type_form" sequence="20" id="menu_action_account_type_form" parent="account_account_menu" groups="base.group_extended"/>
         <!--
     Entries
     -->
             <field name="model">account.move</field>
             <field name="type">tree</field>
             <field name="arch" type="xml">
-                <tree colors="blue:state in ('draft');black:state in ('posted')" string="Journal Entries">
+                <tree colors="blue:state == 'draft';black:state == 'posted'" string="Journal Entries">
                     <field name="name"/>
                     <field name="ref"/>
                     <field name="date"/>
             <field name="type">search</field>
             <field name="arch" type="xml">
                 <search string="Search Taxes">
-                    <group col="10" colspan="4">
+                    <group>
                         <field name="name"/>
                         <field name="description"/>
                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
             <field name="type">tree</field>
             <field eval="4" name="priority"/>
             <field name="arch" type="xml">
-                <tree colors="red:state in ('draft');black:state in ('valid')" string="Journal Items" editable="top" on_write="on_create_write">
+                <tree colors="red:state == 'draft';black:state == 'valid'" string="Journal Items" editable="top" on_write="on_create_write">
                     <field name="date"/>
                     <field name="period_id"/>
                     <field name="move_id"/>
                             <separator string="Internal Note" colspan="4"/>
                             <field name="narration" colspan="4" nolabel="1"/>
                         </page>
-                        <page string="Analytic Lines" groups="base.group_analytic_accounting">
+                        <page string="Analytic Lines" groups="analytic.group_analytic_accounting">
                             <field colspan="4" name="analytic_lines" nolabel="1" context="{'default_general_account_id':account_id, 'default_name': name, 'default_date':date, 'amount': (debit or 0.0)-(credit or 0.0)}"/>
                         </page>
                     </notebook>
                             <field name="reconcile_partial_id"/>
                             <field name="state"/>
                         </page>
-                        <page string="Analytic Lines" groups="base.group_analytic_accounting">
+                        <page string="Analytic Lines" groups="analytic.group_analytic_accounting">
                             <field colspan="4" name="analytic_lines" nolabel="1" />
                         </page>
                     </notebook>
             <field name="type">search</field>
             <field name="arch" type="xml">
                 <search string="Search Journal Items">
-                    <group col='10' colspan='4'>
+                    <group>
                         <filter icon="terp-document-new" string="Unbalanced" domain="[('state','=','draft')]" help="Unbalanced Journal Items"/>
                         <separator orientation="vertical"/>
                         <filter icon="terp-document-new" string="Unposted" domain="[('move_id.state','=','draft')]" help="Unposted Journal Items"/>
                             domain="[('reconcile_id','=',False), ('account_id.reconcile','=',True)]" help="Unreconciled Journal Items"
                             name="unreconciled"/>
                         <separator orientation="vertical"/>
-                        <field name="move_id" select="1" string="Number (Move)"/>
-                        <field name="date" select='1'/>
-                        <field name="account_id" select='1'/>
-                        <field name="partner_id" select='1'>
-                            <filter help="Next Partner Entries to reconcile" name="next_partner" string="Next Partner to reconcile" context="{'next_partner_only': 1}" icon="terp-gtk-jump-to-ltr" domain="[('account_id.reconcile','=',True),('reconcile_id','=',False)]"/>
+                        <field name="move_id" string="Number (Move)"/>
+                        <field name="date"/>
+                        <field name="account_id"/>
+                        <field name="partner_id">
+                            <filter help="Next Partner Entries to reconcile" name="next_partner" context="{'next_partner_only': 1}" icon="terp-gtk-jump-to-ltr" domain="[('account_id.reconcile','=',True),('reconcile_id','=',False)]"/>
                         </field>
                     </group>
                     <newline/>
-                    <group col="10" colspan="4">
-                        <field name="journal_id" widget="selection" context="{'journal_id':self, 'visible_id':self, 'normal_view':False}"/>
-                        <field name="period_id" context="{'period_id':self, 'search_default_period_id':self}"/>
-                    </group>
-                    <newline/>
-                    <group expand="0" string="Extended Filters...">
-                        <field name="ref" select="1" string="Reference"/>
-                        <field name="name" select="1"/>
-                        <field name="narration" select="1"/>
-                        <field name="balance" string="Debit/Credit" select='1'/>
+                    <group>
+                        <field name="journal_id" widget="selection" context="{'journal_id':self}"/>
+                        <field name="period_id" context="{'period_id':self}"/>
                     </group>
                     <newline/>
-                    <group expand="0" string="Group By..." colspan="12" col="10">
+                    <group expand="0" string="Group By...">
                         <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
                         <separator orientation="vertical"/>
                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
             <field name="res_model">account.move.line</field>
             <field name="view_type">form</field>
             <field name="view_mode">tree,form</field>
-            <field name="context">{'search_default_posted': 1}</field>
+            <field name="context">{}</field>
             <field name="search_view_id" ref="view_account_move_line_filter"/>
             <field name="help">This view can be used by accountants in order to quickly record entries in OpenERP. If you want to record a supplier invoice, start by recording the line of the expense account. OpenERP will propose to you automatically the Tax related to this account and the counterpart "Account Payable".</field>
         </record>
             <field name="view_mode">tree,form</field>
             <field name="view_id" ref="view_move_line_tree"/>
             <field name="search_view_id" ref="view_account_move_line_filter"/>
-            <field name="domain">[('account_id', 'child_of', active_id)]</field>
-            <field name="context">{'account_id':active_id}</field>
+            <field name="domain">[]</field>
+            <field name="context">{'search_default_account_id': [active_id]}</field>
         </record>
 
         <record id="ir_account_move_line_select" model="ir.values">
             <field name="model">account.account</field>
             <field name="name">Open Journal Items</field>
             <field eval="'ir.actions.act_window,%d'%action_move_line_select" name="value"/>
-            <field eval="True" name="object"/>
         </record>
         <!--
     Account.Entry Edition
             <field name="model">account.move</field>
             <field name="type">tree</field>
             <field name="arch" type="xml">
-                <tree colors="blue:state in ('draft');black:state in ('posted')" string="Journal Entries">
+                <tree colors="blue:state == 'draft';black:state == 'posted'" string="Journal Entries">
                     <field name="name"/>
                     <field name="ref"/>
                     <field name="date"/>
                                             <separator string="Internal Note" colspan="4"/>
                                             <field name="narration" colspan="4" nolabel="1"/>
                                         </page>
-                                        <page string="Analytic Lines" groups="base.group_analytic_accounting">
+                                        <page string="Analytic Lines" groups="analytic.group_analytic_accounting">
                                             <field colspan="4" name="analytic_lines" nolabel="1" context="{'default_general_account_id':account_id, 'default_name': name, 'default_date':date, 'amount': (debit or 0.0)-(credit or 0.0)}"/>
                                         </page>
                                     </notebook>
                                 </form>
-                                <tree colors="blue:state in ('draft');black:state in ('posted')" editable="top" string="Journal Items">
+                                <tree colors="blue:state == 'draft';black:state == 'posted'" editable="top" string="Journal Items">
                                     <field name="ref"/>
                                     <field name="invoice"/>
                                     <field name="name"/>
                             <group col="4" colspan="4">
                                 <field name="state" select="1"/>
                                 <button name="button_cancel" states="posted" string="Cancel" type="object" icon="gtk-cancel"/>
-                                <button name="button_validate" states="draft" string="Approve" type="object" icon="terp-camera_test"/>
+                                <button name="button_validate" states="draft" string="Post" type="object" icon="terp-camera_test"/>
                             </group>
                         </page>
                     </notebook>
             <field name="type">search</field>
             <field name="arch" type="xml">
                 <search string="Search Move">
-                    <group col='8' colspan='4'>
+                    <group>
                         <filter icon="terp-document-new" string="Unposted" domain="[('state','=','draft')]" help="Unposted Journal Entries"/>
                         <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Journal Entries"/>
                         <separator orientation="vertical"/>
                         <field name="date"/>
                     </group>
                     <newline/>
-                    <group col='8' colspan='4'>
+                    <group>
                         <field name="journal_id" widget="selection"/>
                         <field name="period_id"/>
                     </group>
                     <newline/>
-                    <group expand="0" string="Group By..." colspan="12" col="10">
+                    <group expand="0" string="Group By...">
                         <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
                         <separator orientation="vertical"/>
                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
             context="{'search_default_account_id':[active_id], 'search_default_unreconciled':1, 'default_account_id': active_id}"
             src_model="account.account"/>
 
-        <act_window domain="[('reconcile_id', '=', active_id)]" id="act_account_acount_move_line_reconcile_open" name="Reconciled entries" res_model="account.move.line" src_model="account.move.reconcile"/>
+        <act_window
+            domain="[('reconcile_id', '=', active_id)]"
+            id="act_account_acount_move_line_reconcile_open"
+            name="Reconciled entries"
+            res_model="account.move.line"
+            src_model="account.move.reconcile"/>
 
 
         <!--
             <field name="model">account.journal.period</field>
             <field name="type">tree</field>
             <field name="arch" type="xml">
-                <tree colors="blue:state in ('draft');gray:state in ('done');black:state in ('printed')" string="Journals">
+                <tree colors="blue:state == 'draft';gray:state == 'done';black:state == 'printed'" string="Journals">
                     <field icon="icon" name="fiscalyear_id"/>
                     <field name="period_id"/>
                     <field name="journal_id"/>
                 <tree string="Journal Entry Model Line" editable="bottom">
                     <field name="sequence"/>
                     <field name="name"/>
-                    <field name="account_id"/>
+                    <field name="account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation'), ('company_id', '=', parent.company_id)]"/>
                     <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
                     <field name="partner_id"/>
                     <field name="debit"/>
                 <form string="Journal Entry Model Line">
                     <field colspan="4" name="name" select="1"/>
                     <field name="sequence"/>
-                    <field name="account_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
+                    <field name="account_id" domain="[('type','&lt;&gt;','view'), ('type','&lt;&gt;','consolidation'), ('company_id', '=', parent.company_id)]"/>
                     <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
                     <field name="partner_id"/>
                     <field name="debit" select="1"/>
                     <field name="credit" select="1"/>
-                     <field name="quantity"/>
+                    <field name="quantity"/>
                     <field name="date_maturity"/>
                 </form>
             </field>
             <field name="type">form</field>
             <field name="arch" type="xml">
                 <form string="Payment Term">
-                    <field name="name" select="1"/>
-                    <field name="sequence"/>
-                    <group colspan="2" col="4">
-                        <separator string="Amount Computation" colspan="4"/>
-                        <field name="value" colspan="4"/>
-                        <field name="value_amount" colspan="4" attrs="{'readonly':[('value','=','balance')]}"/>
-                    </group>
-                    <group colspan="2" col="4">
-                        <separator string="Due date Computation" colspan="4"/>
-                        <field name="days" colspan="4"/>
-                        <field name="days2" colspan="4"/>
+                    <group>
+                        <group colspan="2" col="4">
+                            <field name="name" select="1"/>
+                            <separator string="Amount Computation" colspan="4"/>
+                            <field name="value" colspan="4"/>
+                            <field name="value_amount" colspan="4" attrs="{'readonly':[('value','=','balance')]}"/>
+                        </group>
+                        <group colspan="2" col="4">
+                            <field name="sequence"/>
+                            <separator string="Due Date Computation" colspan="4"/>
+                            <field name="days" colspan="4"/>
+                            <field name="days2" colspan="4"/>
+                        </group>
                     </group>
-                    <label string=""/>
                     <newline/>
-                    <label string="Example: at 14 net days 2 percents, remaining amount at 30 days end of month." colspan="4"/>
+                    <separator string="Example" colspan="4"/>
+                    <label string="At 14 net days 2 percent, remaining amount at 30 days end of month." colspan="4"/>
                     <group colspan="2" col="2">
                         <label string="Line 1:" colspan="2"/>
-                        <label string="  valuation: percent"/>
-                        <label string="  number of days: 14"/>
-                        <label string="  value amount: 0.02"/>
-                        <label string="  day of the month: 0"/>
+                        <label string="  Valuation: Percent"/>
+                        <label string="  Number of Days: 14"/>
+                        <label string="  Value amount: 0.02"/>
+                        <label string="  Day of the Month: 0"/>
                     </group>
                     <newline/>
                     <group colspan="2" col="2">
                         <label string="Line 2:" colspan="2"/>
-                        <label string="  valuation: balance"/>
-                        <label string="  number of days: 30"/>
-                        <label string="  value amount: n.a"/>
-                        <label string="  day of the month= -1"/>
+                        <label string="  Valuation: Balance"/>
+                        <label string="  Number of Days: 30"/>
+                        <label string="  Value amount: n.a"/>
+                        <label string="  Day of the Month= -1"/>
                     </group>
                 </form>
             </field>
                     <separator colspan="4" string="Information"/>
                     <field name="name" select="1"/>
                     <field name="active" select="1"/>
-                    <separator colspan="4" string="Description on invoices"/>
+                    <separator colspan="4" string="Description On Invoices"/>
                     <field colspan="4" name="note" nolabel="1"/>
                     <separator colspan="4" string="Computation"/>
                     <field colspan="4" name="line_ids" nolabel="1"/>
             <field name="model">account.subscription</field>
             <field name="type">tree</field>
             <field name="arch" type="xml">
-                <tree colors="blue:state in ('draft');gray:state in ('done');black:state in ('running')" string="Entry Subscription">
+                <tree colors="blue:state == 'draft';gray:state == 'done';black:state == 'running'" string="Entry Subscription">
                     <field name="name"/>
                     <field name="model_id"/>
                     <field name="ref"/>
             <field name="type">search</field>
             <field name="arch" type="xml">
                 <search string="Entry Subscription">
-                    <group col="8" colspan="4">
+                    <group>
                         <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Subscription"/>
                         <filter icon="terp-camera_test" string="Running" domain="[('state','=','running')]" help="Running Subscription"/>
                         <separator orientation="vertical"/>
             <field name="type">tree</field>
             <field eval="4" name="priority"/>
             <field name="arch" type="xml">
-                <tree colors="red:state in ('draft');black:state in ('valid')" string="Journal Items">
+                <tree colors="red:state == 'draft';black:state == 'valid'" string="Journal Items">
                     <field name="date"/>
                     <field name="move_id"/>
                     <field name="statement_id" string="St."/>
             <field name="model">account.tax.code</field>
             <field name="name">Tax Details</field>
             <field eval="'ir.actions.act_window,%d'%action_tax_code_line_open" name="value"/>
-            <field eval="True" name="object"/>
         </record>
 
 
            res_model="account.move.line"
            src_model="account.journal"/>
 
-        <act_window context="{'search_default_reconcile_id':False, 'search_default_partner_id':[active_id], 'default_partner_id': active_id}" domain="[('account_id.reconcile', '=', True),('account_id.type', 'in', ['receivable', 'payable'])]" id="act_account_partner_account_move_all" name="Receivables &amp; Payables" res_model="account.move.line" src_model="res.partner" groups="base.group_extended"/>
+        <act_window
+            context="{'search_default_reconcile_id':False, 'search_default_partner_id':[active_id], 'default_partner_id': active_id}"
+            domain="[('account_id.reconcile', '=', True),('account_id.type', 'in', ['receivable', 'payable'])]"
+            id="act_account_partner_account_move_all"
+            name="Receivables &amp; Payables"
+            res_model="account.move.line"
+            src_model="res.partner"
+            groups="base.group_extended"/>
 
         <act_window context="{'search_default_partner_id':[active_id], 'default_partner_id': active_id}" id="act_account_partner_account_move" name="Journal Items" res_model="account.move.line" src_model="res.partner" groups="account.group_account_user"/>
 
 
                             <field name="currency_id"/>
                             <field name="reconcile"/>
+                            <field name="chart_template_id"/>
                             <separator string="Default taxes" colspan="4"/>
                             <field name="tax_ids" colspan="4" nolabel="1"/>
                         </page>
                 <form string="Chart of Accounts Template">
                     <group>
                     <field name="name"/>
-                    <field name="account_root_id"/>
-                    <field name="bank_account_view_id"/>
-                    <field name="tax_code_root_id"/>
+                    <field name="account_root_id" attrs="{'required': [('parent_id', '=', False)]}"/>
+                    <field name="bank_account_view_id" attrs="{'required': [('parent_id', '=', False)]}"/>
+                    <field name="tax_code_root_id" attrs="{'required': [('parent_id', '=', False)]}"/>
+                    <field name="parent_id" />
+                    <!--<field name="code_digits" />-->
+                    <field name="visible" />
+                    <field name="complete_tax_set" />
                     </group>
                     <field name="tax_template_ids" colspan="4" readonly="1" nolabel="1"/>
                     <separator string="Properties" colspan="4"/>
                         <field name="chart_template_id"/>
                         <field name="type"/>
                         <field name="type_tax_use"/>
-                        <field name="price_include"/>
+                        <group colspan="2" col="4">
+                            <field name="price_include"/>
+                        </group>
                     </group>
                     <notebook colspan="4">
                         <page string="Tax Definition">
             <field name="type">search</field>
             <field name="arch" type="xml">
                 <search string="Search Tax Templates">
-                    <group col="10" colspan="4">
+                    <group>
                         <filter icon="terp-sale" string="Sale" domain="[('type_tax_use','=','sale')]" help="Taxes used in Sales"/>
                         <filter icon="terp-purchase" string="Purchase" domain="[('type_tax_use','=','purchase')]" help="Taxes used in Purchases"/>
                         <separator orientation="vertical"/>
                   <attribute name="string">Accounting Application Configuration</attribute>
                 </form>
                 <separator string="title" position="attributes">
-                <attribute name="string"
-                       >Generate Your Accounting Chart from a Chart Template</attribute>
+                <attribute name="string">Generate Your Chart of Accounts from a Chart Template</attribute>
                   </separator>
                   <xpath expr="//label[@string='description']" position="attributes">
                     <attribute name="string">This will automatically configure your chart of accounts, bank accounts, taxes and journals according to the selected template</attribute>
                   </xpath>
                 <group string="res_config_contents" position="replace">
                     <field name="company_id" widget="selection"/> <!-- we assume that this wizard will be run only by administrators and as this field may cause problem if hidden (because of the default company of the user removed from the selection because already configured), we simply choosed to remove the group "multi company" of it -->
-                    <field name ="code_digits" groups="base.group_extended"/>
-                    <field name="chart_template_id" widget="selection" on_change="onchange_chart_template_id(chart_template_id)"/>
+                    <field name ="code_digits" groups="account.group_account_user"/>
+                    <field name="chart_template_id" widget="selection" on_change="onchange_chart_template_id(chart_template_id)" domain="[('visible','=', True)]"/>
                     <field name ="seq_journal" groups="base.group_extended"/>
-                    <field name="sale_tax" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('sale','all'))]"/>
-                    <field name="purchase_tax" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('purchase', 'all'))]"/>
+                    <field name="sale_tax" attrs="{'invisible': [('complete_tax_set', '!=', True)]}" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('sale','all'))]"/>
+                    <field name="purchase_tax" attrs="{'invisible': [('complete_tax_set', '!=', True)]}" domain="[('chart_template_id', '=', chart_template_id),('parent_id','=',False),('type_tax_use','in',('purchase', 'all'))]"/>
+                    <field name ="sale_tax_rate" attrs="{'invisible': [('complete_tax_set', '=', True)]}"/>
+                    <field name ="purchase_tax_rate" attrs="{'invisible': [('complete_tax_set', '=', True)]}"/>
+                    <field name ="complete_tax_set" invisible="1"/>
                     <newline/> <!-- extended view because the web UI is not good for one2many -->
-                    <field colspan="4" mode="tree" name="bank_accounts_id" nolabel="1" widget="one2many_list" groups="base.group_extended">
+                    <field colspan="4" mode="tree" name="bank_accounts_id" nolabel="1" widget="one2many_list" groups="account.group_account_user">
                         <form string="Bank Information">
                             <field name="acc_name"/>
                             <field name="account_type"/>
             <field name="model_id" ref="base.model_ir_actions_todo"/>
             <field eval="5" name="sequence"/>
             <field name="code">
-act_window_ids = self.pool.get('ir.actions.act_window').search(cr, uid,[('name', 'in', ('Accounting Chart Configuration', 'Generate Chart of Accounts from a Chart Template'))], context=context)
-todo_ids = self.pool.get('ir.actions.todo').search(cr, uid, [('action_id', 'in', act_window_ids)], context=context)
-self.pool.get('ir.actions.todo').write(cr, uid, todo_ids, {'state':'open'}, context=context)
-action = self.pool.get('res.config').next(cr, uid, [], context)
+act_window_ids = pool.get('ir.actions.act_window').search(cr, uid,[('name', 'in', ('Accounting Chart Configuration', 'Generate Chart of Accounts from a Chart Template'))], context=context)
+todo_ids = pool.get('ir.actions.todo').search(cr, uid, [('action_id', 'in', act_window_ids)], context=context)
+pool.get('ir.actions.todo').write(cr, uid, todo_ids, {'state':'open'}, context=context)
+action = pool.get('res.config').next(cr, uid, [], context)
 </field>
            <field name="name">New Company Financial Setting</field>
         </record>
@@ -2537,7 +2590,7 @@ action = self.pool.get('res.config').next(cr, uid, [], context)
             <field name="model">account.bank.statement</field>
             <field name="type">tree</field>
             <field name="arch" type="xml">
-                <tree colors="red:balance_end_real!=balance_end;blue:state=='draft' and (balance_end_real==balance_end);black:state in ('open')" string="Statement">
+                <tree colors="red:balance_end_real!=balance_end;blue:state=='draft' and (balance_end_real==balance_end);black:state == 'open'" string="Statement">
                     <field name="name"/>
                     <field name="date"/>
                     <field name="period_id"/>
@@ -2562,7 +2615,7 @@ action = self.pool.get('res.config').next(cr, uid, [], context)
                     <group col="6" colspan="4">
                         <field name="name" select="1"/>
                         <field name="company_id" select="1" groups="base.group_multi_company"/>
-                        <field name="journal_id" on_change="onchange_journal_id(journal_id)" domain="[('type','=','cash')]" select="1" widget="selection"/>
+                        <field name="journal_id" on_change="onchange_journal_id(journal_id)" select="1" widget="selection"/>
                         <field name="user_id" select="1" readonly="1"/>
                         <field name="period_id" select="1"/>
                         <field name="currency" invisible="1"/>
@@ -2570,7 +2623,7 @@ action = self.pool.get('res.config').next(cr, uid, [], context)
 
                     <notebook colspan="4">
                         <page string="Cash Transactions" attrs="{'invisible': [('state','=','draft')]}">
-                            <field colspan="4" name="line_ids" nolabel="1">
+                            <field colspan="4" name="line_ids" nolabel="1" context="{'date':date}">
                                 <tree editable="bottom" string="Statement lines">
                                     <field name="sequence" invisible="1"/>
                                     <field name="date" groups="base.group_extended"/>
@@ -2644,12 +2697,12 @@ action = self.pool.get('res.config').next(cr, uid, [], context)
                         </group>
                         <group col="2" colspan="2">
                             <separator string="Closing Balance" colspan="4"/>
-                            <field name="balance_end" string="Calculated Balance"/>
-                            <field name="balance_end_cash" string="CashBox Balance"/>
+                            <field name="balance_end"/>
+                            <field name="balance_end_cash"/>
                         </group>
                     </group>
                     <group col="8" colspan="4">
-                        <field name="state" colspan="4"/>
+                        <field name="state" widget="statusbar" statusbar_visible="draft,confirm" colspan="4"/>
                         <button name="button_cancel" states="confirm,open" string="Cancel" icon="terp-gtk-stop" type="object" groups="base.group_extended"/>
                         <button name="button_confirm_cash" states="open" string="Close CashBox" icon="terp-dialog-close" type="object"/>
                         <button name="button_open" states="draft" string="Open CashBox" icon="gtk-go-forward" type="object"/>
@@ -2710,5 +2763,113 @@ action = self.pool.get('res.config').next(cr, uid, [], context)
             parent="menu_finance_payables"
             action="base.action_partner_supplier_form" sequence="100"/>
 
+        <!--
+            Account Reports
+        -->
+
+        <record id="view_account_financial_report_form" model="ir.ui.view">
+            <field name="name">account.financial.report.form</field>
+            <field name="model">account.financial.report</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <form string="Account Report">
+                    <group col="6" colspan="4">
+                        <field name="name"/>
+                        <field name="parent_id"/>
+                        <field name="sequence"/>
+                        <field name="type"/>
+                    </group>
+                    <notebook colspan="4">
+                        <page string="Report" attrs="{'invisible': [('state','!=','confirm')]}">
+                            <field name="display_detail" attrs="{'invisible': [('type','!=','accounts')]}"/>
+                            <newline/>
+                            <field name="account_ids" nolabel="1" colspan="6" attrs="{'invisible': [('type', '!=', 'accounts')]}"/>
+                            <newline/>
+                            <field name="account_report_id" attrs="{'invisible': [('type', '!=', 'account_report')]}"/>
+                            <newline/>
+                            <field name="account_type_ids" nolabel="1" attrs="{'invisible': [('type', '!=', 'account_type')]}"/>
+                            <newline/>
+                        </page>
+                        <page string="Notes" attrs="{'invisible': [('state','!=','confirm')]}">
+                            <field name="note" nolabel="1" colspan="4"/>
+                        </page>
+                    </notebook>
+                </form>
+            </field>
+        </record>
+
+        <record id="view_account_financial_report_tree" model="ir.ui.view">
+            <field name="name">account.financial.report.tree</field>
+            <field name="model">account.financial.report</field>
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <tree string="Account Report">
+                    <field name="name"/>
+                    <field name="parent_id" invisible="1"/>
+                    <field name="type"/>
+                    <field name="account_report_id"/>
+                </tree>
+            </field>
+        </record>
+
+        <record id="view_account_financial_report_search" model="ir.ui.view">
+            <field name="name">account.financial.report.search</field>
+            <field name="model">account.financial.report</field>
+            <field name="type">search</field>
+            <field name="arch" type="xml">
+                <search string="Account Report">
+                    <group>
+                        <field name="name"/>
+                        <field name="type"/>
+                        <field name="account_report_id"/>
+                    </group>
+                    <newline/>
+                    <group expand="0" string="Group By...">
+                        <filter string="Parent Report" icon="terp-folder-orange" domain="" context="{'group_by':'parent_id'}"/>
+                        <separator orientation="vertical"/>
+                        <filter string="Report Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
+                    </group>
+                </search>
+            </field>
+        </record>
+
+        <record id="action_account_financial_report_tree" model="ir.actions.act_window">
+            <field name="name">Financial Reports</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">account.financial.report</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+            <field name="search_view_id" ref="view_account_financial_report_search"/>
+            <field name="view_id" ref="view_account_financial_report_tree"/>
+            <field name="help">Makes a generic system to draw financial reports easily.</field>
+        </record>
+
+        <menuitem id="menu_account_financial_reports_tree" name="Account Reports" parent="menu_account_reports" action="action_account_financial_report_tree"/>
+
+        <record id="view_account_report_tree_hierarchy" model="ir.ui.view">
+            <field name="name">account.report.hierarchy</field>
+            <field name="model">account.financial.report</field>
+            <field name="type">tree</field>
+            <field name="field_parent">children_ids</field>
+            <field name="arch" type="xml">
+                <tree string="Account Reports Hierarchy">
+                    <field name="name"/>
+                    <field name="type"/>
+                    <field name="parent_id" invisible="1"/>
+                    <field name="account_report_id"/>
+                </tree>
+            </field>
+        </record>
+        <record id="action_account_report_tree_hierarchy" model="ir.actions.act_window">
+            <field name="name">Financial Reports Hierarchy</field>
+            <field name="res_model">account.financial.report</field>
+            <field name="view_type">tree</field>
+            <field name="view_id" ref="view_account_report_tree_hierarchy"/>
+            <field name="domain">[('parent_id','=',False)]</field>
+        </record>
+
+        <menuitem id="menu_account_report_tree_hierarchy" name="Account Reports Hierarchy"
+                  parent="menu_account_reports" action="action_account_report_tree_hierarchy"/>
+
     </data>
 </openerp>