[MERGE]Merged with 7.0
[odoo/odoo.git] / addons / account / account_view.xml
index 7d18961..b8dcefd 100644 (file)
@@ -97,7 +97,7 @@
                 <form string="Account Period" version="7.0">
                     <header>
                         <button string="Close Period" name="%(account.action_account_period_close)d" type="action" class="oe_highlight" states="draft"/>
-                        <button name="action_draft" states="done" string="Set to Draft" type="object" groups="account.group_account_manager"/>
+                        <button name="action_draft" states="done" string="Re-Open Period" type="object" groups="account.group_account_manager"/>
                         <field name="state" widget="statusbar" nolabel="1"/>
                     </header>
                     <sheet>
               </p>
             </field>
         </record>
-        <menuitem id="menu_action_account_period" action="action_account_period" parent="account.next_id_23" groups="base.group_no_one"/>
+        <menuitem id="menu_action_account_period" action="action_account_period" parent="account.next_id_23"/>
 
         <!-- Accounts -->
         <record id="view_account_form" model="ir.ui.view">
             res_model="account.move.line"
             src_model="account.account"/>
 
+        <!-- Enable drill-down from Chart Of Accounts tree view -->
+        <act_window
+            id="action_account_items"
+            name="Journal Items"
+            context="{'search_default_account_id': [active_id]}"
+            res_model="account.move.line"
+            src_model="account.account"
+            key2="tree_but_open"/>
+
         <!-- Account Journal -->
         <record id="view_account_journal_tree" model="ir.ui.view">
             <field name="name">account.journal.tree</field>
                                 <group string="Accounts">
                                     <field name="profit_account_id" domain="[('type','!=','view')]"/>
                                     <field name="loss_account_id" domain="[('type','!=','view')]"/>
-                                    <field name="internal_account_id"/>
+                                    <field name="internal_account_id" domain="[('type','!=','view')]"/>
                                 </group>
                                 <group string="Miscellaneous">
                                     <field name="with_last_closing_balance"/>
-                                    <field name="cash_control"/>
+                                    <field name="cash_control" attrs="{'invisible':[('type','not in', ('cash',))]}"/>
                                 </group>
                             </group>
-                            <separator string="Available Coins" colspan="4" attrs="{'invisible' : [('cash_control', '=', False)] }"/>
-                            <field name="cashbox_line_ids" nolabel="1" string="Unit Of Currency Definition" colspan="4" attrs="{'invisible' : [('cash_control', '=', False)]}">
+                            <separator string="Available Coins" colspan="4" attrs="{'invisible' : ['|',('cash_control', '=', False),('type','not in', ('cash',))] }"/>
+                            <field name="cashbox_line_ids" nolabel="1" string="Unit Of Currency Definition" colspan="4" attrs="{'invisible' : ['|',('cash_control', '=', False),('type','not in', ('cash',))]}">
                                 <tree string="CashBox Lines" editable="bottom">
                                     <field name="pieces" />
                                 </tree>
         <record id="view_bank_statement_form" model="ir.ui.view">
             <field name="name">account.bank.statement.form</field>
             <field name="model">account.bank.statement</field>
+            <field name="priority">1</field>
             <field name="arch" type="xml">
                 <form string="Bank Statement" version="7.0">
                 <header>
                     <button name="button_confirm_bank" states="draft" string="Confirm" type="object" class="oe_highlight"/>
                     <button name="button_dummy" states="draft" string="Compute" type="object" class="oe_highlight"/>
-                    <button name="button_cancel" states="confirm" string="Cancel" type="object"/>
+                    <button name="button_cancel" states="confirm" string="Cancel Statement" type="object"/>
                     <field name="state" widget="statusbar" statusbar_visible="draft,confirm"/>
                 </header>
                 <sheet>
                     <div class="oe_right oe_button_box" name="import_buttons">
                        <!-- Put here related buttons -->
                     </div>
-                    <label for="name" class="oe_edit_only" attrs="{'invisible':[('name','=','/')]}"/>
-                    <h1>
-                        <field name="name" attrs="{'invisible':[('name','=','/')]}"/>
-                    </h1>
+                    <label for="name" class="oe_edit_only"/>
+                    <h1><field name="name"/></h1>
                     <group>
                         <group>
                             <field name="journal_id" domain="[('type', '=', 'bank')]" on_change="onchange_journal_id(journal_id)" widget="selection"/>
                             <field name="line_ids" context="{'date':date}">
                                 <tree editable="bottom" string="Statement lines">
                                     <field name="sequence" readonly="1" invisible="1"/>
-                                    <field name="name" invisible="1"/>
                                     <field name="date"/>
-                                    <field name="note"/>
+                                    <field name="name"/>
                                     <field name="ref"/>
-                                    <field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
+                                    <field name="partner_id" on_change="onchange_partner_id(partner_id)" domain="['|',('parent_id','=',False),('is_company','=',True)]"/>
                                     <field name="type" on_change="onchange_type(partner_id, type)"/>
                                     <field name="account_id" options='{"no_open":True}' domain="[('journal_id','=',parent.journal_id), ('company_id', '=', parent.company_id)]"/>
                                     <field name="analytic_account_id" groups="analytic.group_analytic_accounting" domain="[('company_id', '=', parent.company_id), ('type', '&lt;&gt;', 'view')]"/>
             res_model="account.move.line"
             src_model="account.tax.code"/>
 
+        <!-- Enable drill-down from Chart Of Taxes tree view -->
+        <act_window
+            id="action_tax_code_items"
+            name="Journal Items"
+            domain="[('tax_code_id','child_of',active_id),('state','!=','draft')]"
+            res_model="account.move.line"
+            src_model="account.tax.code"
+            key2="tree_but_open"/>
+
+
         <!-- Tax -->
         <record id="view_tax_tree" model="ir.ui.view">
             <field name="name">account.tax.tree</field>
                             </group>
                             <group string="Invoices">
                                   <field name="account_collected_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
-                                  <field name="account_analytic_collected_id" domain="[('type','&lt;&gt;','view'), ('company_id', '=', company_id), ('parent_id', '&lt;&gt;', False)]" groups="analytic.group_analytic_accounting"/>
+                                  <field name="account_analytic_collected_id" domain="[('type','&lt;&gt;','view'), ('company_id', '=', company_id)]" groups="analytic.group_analytic_accounting"/>
 
                                   <field name="base_code_id"/>
                                   <field name="base_sign"/>
                             </group>
                             <group string="Refunds">
                                   <field name="account_paid_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
-                                  <field name="account_analytic_paid_id" domain="[('type','&lt;&gt;','view'), ('company_id', '=', company_id), ('parent_id', '&lt;&gt;', False)]" groups="analytic.group_analytic_accounting"/>
+                                  <field name="account_analytic_paid_id" domain="[('type','&lt;&gt;','view'), ('company_id', '=', company_id)]" groups="analytic.group_analytic_accounting"/>
 
                                   <field name="ref_base_code_id"/>
                                   <field name="ref_base_sign"/>
                                         <field name="blocked"/>
                                     </group>
                                     <group groups="analytic.group_analytic_accounting" string="Analytic">
-                                        <field name="analytic_account_id" domain="[('parent_id','!=',False)]"/>
+                                        <field name="analytic_account_id" domain="[('type','in',('normal','contract'))]"/>
                                     </group>
                                 </group>
                                 <field name="narration" colspan="4" nolabel="1" placeholder="Add an internal note..."/>
                                 <field name="blocked"/>
                                 <newline/>
                                 <field name="account_tax_id" domain="[('parent_id','=',False)]"/>
-                                <field name="analytic_account_id" domain="[('parent_id','!=',False)]" groups="analytic.group_analytic_accounting"/>
+                                <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
                                 <separator colspan="4" string="Status"/>
                                 <newline/>
                                 <field name="reconcile_id"/>
                     <separator/>
                     <filter string="Next Partner to Reconcile" 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 name="move_id" string="Number (Move)"/>
-                    <field name="account_id" filter_domain="['|', ('name', 'ilike', self), ('code', 'ilike', self)]"/>
+                    <field name="account_id"/>
                     <field name="partner_id"/>
                     <field name="journal_id" context="{'journal_id':self}" widget="selection"/> <!-- it's important to keep widget='selection' in this filter viewbecause without that the value passed in the context is not the ID but the textual value (name) of the selected journal -->
                     <field name="period_id" context="{'period_id':self}" widget="selection"/> <!-- it's important to keep the widget='selection' in this field, for the same reason as explained above -->
             <field name="name">Journal Items</field>
             <field name="res_model">account.move.line</field>
             <field name="view_id" ref="view_move_line_tree"/>
-            <field name="view_mode">tree_account_move_line_quickadd</field>
+            <field name="view_mode">tree_account_move_line_quickadd,form</field>
             <field name="help" type="html">
               <p class="oe_view_nocontent_create">
                 Select the period and the journal you want to fill.
                     <field name="name"/>
                     <field name="partner_id"/>
                     <field name="account_id"/>
+                    <field name="period_id" invisible="1"/>
+                    <field name="journal_id" invisible="1"/>
                     <field name="reconcile_partial_id"/>
                     <field name="state" invisible="1"/>
                     <field name="debit" sum="Total debit"/>
                 <form string="Account Entry" version="7.0">
                 <header>
                     <button name="button_validate" states="draft" string="Post" type="object" class="oe_highlight" groups="account.group_account_invoice"/>
-                    <button name="button_cancel" states="posted" string="Cancel" type="object" groups="account.group_account_invoice"/>
+                    <button name="button_cancel" states="posted" string="Cancel Entry" type="object" groups="account.group_account_invoice"/>
                     <field name="state" widget="statusbar"/>
                 </header>
                 <sheet string="Journal Entries" >
                                                 </group>
 
                                                 <group groups="analytic.group_analytic_accounting" string="Analytic">
-                                                    <field name="analytic_account_id" domain="[('parent_id','!=',False)]"/>
+                                                    <field name="analytic_account_id"/>
                                                 </group>
                                             </group>
                                             <separator string="Internal Note"/>
                                     <field name="date_maturity"/>
                                     <field name="debit" sum="Total Debit"/>
                                     <field name="credit" sum="Total Credit"/>
-                                    <field name="analytic_account_id" domain="[('parent_id','!=',False)]" groups="analytic.group_analytic_accounting"/>
+                                    <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
                                     <field name="amount_currency"/>
                                     <field name="currency_id" groups="base.group_multi_currency"/>
                                     <field name="tax_code_id"/>
             <field name="model">account.payment.term.line</field>
             <field name="arch" type="xml">
                 <tree string="Payment Term">
-                    <field name="sequence"/>
-                    <field name="name"/>
                     <field name="value"/>
-                    <field name="value_amount"/>
+                    <field name="value_amount" attrs="{'readonly':[('value','=','balance')]}"/>
                     <field name="days"/>
                     <field name="days2"/>
                 </tree>
             <field name="arch" type="xml">
                 <form string="Payment Term" version="7.0">
                     <group>
-                        <field name="name"/>
-                        <field name="sequence"/>
-                    </group>
-                    <group>
                         <group string="Amount Computation">
-                            <field name="value"/>
-                            <field name="value_amount" attrs="{'readonly':[('value','=','balance')]}"/>
+                               <field name="value"/>
+                               <label for="value_amount" string="Amount To Pay"  attrs="{'invisible':[('value','=','balance')]}"/>
+                               <div attrs="{'invisible':[('value','=','balance')]}">
+                                   <field name="value_amount" class="oe_inline"/>
+                                   <label string="%%" class="oe_inline" attrs="{'invisible':['!',('value','=','procent')]}" />
+                               </div>
                         </group>
                         <group string="Due Date Computation">
                             <field name="days"/>
                             <field name="days2"/>
                         </group>
                     </group>
-
-                    <separator string="Example"/>
-                    <label string="At 14 net days 2 percent, remaining amount at 30 days end of month."/>
-                    <group>
-                        <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"/>
-                    </group>
-                    <group>
-                        <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"/>
-                    </group>
                 </form>
             </field>
         </record>
                         <field name="name"/>
                         <field name="active"/>
                     </group>
-                    <field name="note" placeholder="Note for the invoice..."/>
+                    <field name="note" placeholder="Payment term explanation for the customer..."/>
                     <separator string="Computation"/>
                     <field name="line_ids"/>
                 </form>
         <record id="view_bank_statement_form2" model="ir.ui.view">
             <field name="name">account.bank.statement.form</field>
             <field name="model">account.bank.statement</field>
+            <field name="priority">2</field>
             <field name="arch" type="xml">
                 <form string="Statement" version="7.0">
                 <header>
                     <button name="button_confirm_cash" states="open" string="Close CashBox" type="object" class="oe_highlight"/>
                     <button name="button_open" states="draft" string="Open CashBox" type="object" class="oe_highlight"/>
-                    <button name="button_cancel" states="confirm,open" string="Cancel" type="object"/>
+                    <button name="button_cancel" states="confirm,open" string="Cancel CashBox" type="object"/>
                     <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,confirm"/>
                 </header>
                 <sheet string="Statement">