[FIX] /web/login restore request.uid in case of authentication failure
[odoo/odoo.git] / addons / account_voucher / account_voucher_view.xml
index 09fe0d2..3e4f163 100644 (file)
@@ -4,7 +4,6 @@
         <record model="ir.ui.view" id="view_voucher_tree">
             <field name="name">account.voucher.tree</field>
             <field name="model">account.voucher</field>
-            <field name="type">tree</field>
             <field name="arch" type="xml">
                 <tree colors="blue:state == 'draft';gray:state == 'cancel';red:audit" string="Voucher Entries">
                     <field name="date"/>
@@ -23,7 +22,6 @@
         <record model="ir.ui.view" id="view_voucher_line_form">
             <field name="name">account.voucher.line.form</field>
             <field name="model">account.voucher.line</field>
-            <field name="type">form</field>
             <field name="arch" type="xml">
                 <form string="Voucher Lines" version="7.0">
                     <group col="4">
             </field>
         </record>
 
+        <!-- This general view is used in 
+             Invoicing - Journal Entries - Journal Vouchers -->
         <record model="ir.ui.view" id="view_voucher_form">
             <field name="name">account.voucher.form</field>
             <field name="model">account.voucher</field>
-            <field name="type">form</field>
             <field name="arch" type="xml">
-                <form version="7.0">
+                <form string="Accounting Voucher" version="7.0">
                   <header>
                       <button name="proforma_voucher" string="Post" states="draft" class="oe_highlight"/>
-                      <button name="cancel_voucher" string="Cancel" type="object" states="posted" confirm="Are you sure to unreconcile this record?"/>
-                      <button name="cancel_voucher" string="Cancel" states="draft,proforma" />
+                      <button name="cancel_voucher" string="Cancel Voucher" type="object" states="posted" confirm="Are you sure you want to unreconcile this record?"/>
+                      <button name="cancel_voucher" string="Cancel Voucher" states="draft,proforma" />
                       <button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
                       <field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
                   </header>
                   <sheet string="Accounting Voucher">
-                    <group col="6" colspan="4">
+                    <group col="4" colspan="4">
                         <field name="partner_id" required="1" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>
                         <field name="date" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id)"/>
                         <field name="journal_id" widget="selection" on_change="onchange_journal_voucher(line_ids, tax_id, amount, partner_id, journal_id, type)"/>
                         <field name="name" colspan="2"/>
                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
                         <field name="reference"/>
+                        <field name="number"/>
+                        <field name="currency_id" groups="base.group_multi_currency"/>
                         <field name="account_id" widget="selection" invisible="True"/>
+                        <field name="payment_rate_currency_id" invisible="1"/>
                     </group>
                     <notebook colspan="4">
                         <page string="Voucher Entry">
                                     <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
                                 </tree>
                             </field>
-                            <group col="3">
-                                <group string="Internal Notes">
-                                    <field name="narration" colspan="2" nolabel="1"/>
-                                </group>
-                                <group string="Other Information">
-                                    <field name="number"/>
-                                    <field name="currency_id"/>
-                                </group>
-                                <group col="4" attrs="{'invisible':[('type','in',['payment', 'receipt', False])]}">
-                                    <separator string="Total" colspan="4"/>
-                                    <field name="tax_id" on_change="onchange_price(line_ids, tax_id, partner_id)" widget="selection"/>
+                            <group>
+                                <field name="narration" nolabel="1" placeholder="Internal Notes"/>
+                                <group class="oe_subtotal_footer oe_right" attrs="{'invisible':[('type','in',['payment', 'receipt', False])]}">
+                                    <field name="tax_id" on_change="onchange_price(line_ids, tax_id, partner_id)" widget="selection" nolabel="1"/>
                                     <field name="tax_amount" nolabel="1"/>
-                                    <button type="object" icon="terp-stock_format-scientific" name="compute_tax" string="Compute Tax" attrs="{'invisible': [('state','!=','draft')]}"/>
-                                    <label colspan="1" string=""/><field name="amount" string="Total"/>
+                                    <div class="oe_subtotal_footer_separator">
+                                        <label for="amount"/>
+                                        <button type="object" name="compute_tax" class="oe_link oe_edit_only" string="(Update)" attrs="{'invisible': [('state','!=','draft')]}"/>
+                                    </div>
+                                    <field name="amount" class="oe_subtotal_footer_separator" nolabel="1"/>
                                 </group>
                             </group>
                         </page>
                     </notebook>
                   </sheet>
                   <div class="oe_chatter">
+                      <field name="message_follower_ids" widget="mail_followers"/>
                       <field name="message_ids" widget="mail_thread"/>
                   </div>
                 </form>
             </field>
         </record>
-        
+
         <record id="view_voucher_filter" model="ir.ui.view">
             <field name="name">account.voucher.select</field>
             <field name="model">account.voucher</field>
-            <field name="type">search</field>
             <field name="priority">1</field>
             <field name="arch" type="xml">
                 <search string="Search Vouchers">
-                    <group>
-                        <field name="number" string="Voucher"/>
-                        <separator orientation="vertical"/>
-                        <field name="date"/>
-                        <separator orientation="vertical"/>
-                        <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
-                        <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
-                        <separator orientation="vertical"/>
-                        <filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted'), ('audit','=',False)]" help="To Review"/>
-                        <separator orientation="vertical"/>
-                        <field name="partner_id"/>
-                        <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" />
-                        <field name="period_id"/>
-                    </group>
-                    <newline/>
+                    <field name="number" string="Voucher"/>
+                    <field name="date"/>
+                    <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Vouchers"/>
+                    <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Vouchers"/>
+                    <separator/>
+                    <filter icon="terp-gtk-jump-to-ltr" string="To Review" domain="[('state','=','posted'), ('audit','=',False)]" help="To Review"/>
+                    <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>
+                    <field name="journal_id" widget="selection" context="{'journal_id': self, 'set_visible':False}" /> <!-- Keep widget=selection on this field to pass numeric `self` value, which is not the case for regular m2o widgets! -->
+                    <field name="period_id"/>
                     <group expand="0" string="Group By...">
                         <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
                         <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal_id'}"/>
         <record id="account_cash_statement_graph" model="ir.ui.view">
             <field name="name">account.voucher.graph</field>
             <field name="model">account.voucher</field>
-            <field name="type">graph</field>
             <field name="arch" type="xml">
                 <graph string="Voucher Statistics" type="bar">
                     <field name="date"/>
             <field name="view_id" ref="view_voucher_form"/>
             <field name="act_window_id" ref="action_voucher_list"/>
         </record>
-        <menuitem action="action_voucher_list" id="menu_encode_entries_by_voucher" parent="account.menu_finance_entries" sequence="6"/>
+        <menuitem action="action_voucher_list" id="menu_encode_entries_by_voucher" parent="account.menu_finance_entries" sequence="6" groups="base.group_no_one"/>
 
         <act_window
             id="act_journal_voucher_open"
         <record id="view_bank_statement_form_invoice" model="ir.ui.view">
             <field name="name">account.bank.statement.invoice.form.inherit</field>
             <field name="model">account.bank.statement</field>
-            <field name="type">form</field>
             <field name="inherit_id" ref="account.view_bank_statement_form"/>
             <field name="arch" type="xml">
                 <xpath expr="//div[@name='import_buttons']" position="inside">
                     <button name="%(action_view_account_statement_from_invoice_lines)d"
-                            string="Import Invoices" type="action" icon="gtk-execute"
+                            string="Import Invoices" type="action"
                             attrs="{'invisible':[('state','=','confirm')]}"/>
                 </xpath>
             </field>
         </record>
 
-        <record id="view_bank_statement_tree_voucher" model="ir.ui.view">
+        <record id="view_bank_statement_form_voucher" model="ir.ui.view">
             <field name="name">account.bank.statement.voucher.tree.inherit</field>
             <field name="model">account.bank.statement</field>
-            <field name="type">form</field>
             <field name="inherit_id" ref="account.view_bank_statement_form"/>
             <field name="arch" type="xml">
                 <xpath expr="//page[@name='statement_line_ids']/field[@name='line_ids']/tree/field[@name='amount']" position="after">
-                    <field name="voucher_id" context="{'line_type': type, 'default_type': amount &lt; 0 and 'payment' or 'receipt', 'type': amount &lt; 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name}"/>
+                    <field name="voucher_id" string="" widget="many2onebutton" options="{'label':{'create':'Reconcile','edit':'Edit Reconciliation'}}" context="{'line_type': type, 'default_type': amount &lt; 0 and 'payment' or 'receipt', 'type': amount &lt; 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name, 'default_active': False, 'account_id': account_id}"/>
                 </xpath>
-            </field>
-        </record>
-
-        <record id="view_bank_statement_form_voucher" model="ir.ui.view">
-            <field name="name">account.bank.statement.voucher.form.inherit</field>
-            <field name="model">account.bank.statement</field>
-            <field name="type">form</field>
-            <field name="inherit_id" ref="account.view_bank_statement_form"/>
-            <field name="arch" type="xml">
                 <xpath expr="//page[@name='statement_line_ids']/field[@name='line_ids']/form/group/field[@name='sequence']" position="before">
-                    <field name="voucher_id" context="{'line_type': type, 'default_type': amount &lt; 0 and 'payment' or 'receipt', 'type': amount &lt; 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name}"/>
+                    <field name="voucher_id" widget="many2onebutton" options="{'label':{'create':'Reconcile','edit':'Edit Reconciliation'}}" context="{'line_type': type, 'default_type': amount &lt; 0 and 'payment' or 'receipt', 'type': amount &lt; 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name, 'default_active': False, 'account_id': account_id}"/>
                 </xpath>
+                <field name="amount" position="attributes">
+                    <attribute name="on_change">onchange_amount(amount)</attribute>
+                </field>
             </field>
         </record>
+
         <record id="view_cash_statement_tree_voucher" model="ir.ui.view">
             <field name="name">account.cash.statement.voucher.tree.inherit</field>
             <field name="model">account.bank.statement</field>
-            <field name="type">form</field>
             <field name="inherit_id" ref="account.view_bank_statement_form2"/>
             <field name="arch" type="xml">
                 <xpath expr="//page/field[@name='line_ids']/tree/field[@name='amount']" position="after">
-                    <field name="voucher_id" context="{'line_type': type, 'default_type': amount &lt; 0 and 'payment' or 'receipt', 'type': amount &lt; 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name}"/>
+                    <field name="voucher_id" context="{'line_type': type, 'default_type': amount &lt; 0 and 'payment' or 'receipt', 'type': amount &lt; 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name, 'account_id': account_id}"/>
                 </xpath>
             </field>
         </record>
         <record id="view_cash_statement_form_voucher" model="ir.ui.view">
             <field name="name">account.cash.statement.voucher.form.inherit</field>
             <field name="model">account.bank.statement</field>
-            <field name="type">form</field>
             <field name="inherit_id" ref="account.view_bank_statement_form2"/>
             <field name="arch" type="xml">
                 <xpath expr="//page/field[@name='line_ids']/form/group/field[@name='amount']" position="after">
-                    <field name="voucher_id" context="{'line_type': type, 'default_type': amount &lt; 0 and 'payment' or 'receipt', 'type': amount &lt; 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name}"/>
+                    <field name="voucher_id" context="{'line_type': type, 'default_type': amount &lt; 0 and 'payment' or 'receipt', 'type': amount &lt; 0 and 'payment' or 'receipt', 'default_partner_id': partner_id, 'default_journal_id': parent.journal_id, 'default_amount': abs(amount), 'default_reference': ref, 'default_date': date, 'default_name': name, 'account_id': account_id}"/>
                 </xpath>
             </field>
         </record>
 
-        <!-- res.company form view -->
-        <record model="ir.ui.view" id="view_company_inherit_currency_xchange_form">
-            <field name="name">res.company.form.inherit</field>
-            <field name="inherit_id" ref="base.view_company_form"/>
-            <field name="model">res.company</field>
-            <field name="type">form</field>
+        <!-- res.config form view -->
+        <record model="ir.ui.view" id="view_account_settings_currency_xchange_form">
+            <field name="name">account.config.settings.inherit</field>
+            <field name="inherit_id" ref="account.view_account_config_settings"/>
+            <field name="model">account.config.settings</field>
+            <field name="priority">20</field>
             <field name="arch" type="xml">
-                <field name="currency_id" position="after">
-                      <field name="income_currency_exchange_account_id"/>
-                      <field name="expense_currency_exchange_account_id"/>
-                </field>
+                <xpath expr="//div[@name='group_multi_currency']" position="after">
+                    <group attrs="{'invisible': [('group_multi_currency', '&lt;&gt;', True)]}" col="2">
+                        <group>
+                            <field name="income_currency_exchange_account_id"/>
+                            <field name="expense_currency_exchange_account_id"/>
+                        </group>
+                        <group>
+                        </group>
+                    </group>
+                </xpath>
             </field>
         </record>
 
     </data>
+    <data noupdate="1">
+
+        <!-- After installation of the module, open the related menu -->
+        <record id="action_client_invoice_menu" model="ir.actions.client">
+            <field name="name">Open Invoicing Menu</field>
+            <field name="tag">reload</field>
+            <field name="params" eval="{'menu_id': ref('account.menu_finance')}"/>
+        </record>
+        <record id="base.open_menu" model="ir.actions.todo">
+            <field name="action_id" ref="action_client_invoice_menu"/>
+            <field name="state">open</field>
+        </record>
+
+    </data>
 </openerp>