[FIX] account: several fixes on the new bank statement reconciliation widget
[odoo/odoo.git] / addons / account / account_view.xml
index 934475c..a14934a 100644 (file)
         <record id="action_bank_reconcile_bank_statements" model="ir.actions.client">
             <field name="name">Reconciliation on Bank Statements</field>
             <field name="tag">bank_statement_reconciliation_view</field>
-            <field name="context">{'statement_id': active_id}</field>
+            <field name="context">{'statement_ids': [active_id]}</field>
         </record>
         
         <record id="view_account_bank_statement_filter" model="ir.ui.view">
                         <button class="oe_inline oe_stat_button" name="%(action_view_account_statement_from_invoice_lines)d"
                             string="Import Invoice" type="action"
                             attrs="{'invisible':[('state','=','confirm')]}" widget="statinfo" icon="fa-pencil-square-o"/>
+                        <button class="oe_inline oe_stat_button" name="button_journal_entries"
+                                string="Journal Items" type="object"
+                                attrs="{'invisible':[('move_line_ids','=',[])]}" icon="fa-bars"/>
+                        <field name="move_line_ids" invisible="1"/>
                     </div>
                     <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="journal_id" domain="[('type', '=', 'bank')]" on_change="onchange_journal_id(journal_id)" attrs="{'readonly': [('move_line_ids', '!=', [])]}" widget="selection"/>
                             <label for="date" string="Date / Period"/>
                             <div>
                                 <field name="date" on_change="onchange_date(date, company_id)" class="oe_inline"/>
             </field>
         </record>
 
-        <record id="view_bank_statement_form_journal_items" model="ir.ui.view">
-            <field name="name">account.bank.statement.journal.items.form.inherit</field>
-            <field name="model">account.bank.statement</field>
-            <field name="inherit_id" ref="view_bank_statement_form"/>
-            <field name="arch" type="xml">
-                <xpath expr="//div[@name='import_buttons']" position="inside">
-                    <button name="button_journal_entries"
-                            string="Journal Items" type="object"
-                            attrs="{'invisible':[('state','!=','confirm')]}"/>
-                </xpath>
-            </field>
-        </record>
-
         <record id="action_bank_statement_tree" model="ir.actions.act_window">
             <field name="name">Bank Statements</field>
             <field name="res_model">account.bank.statement</field>
                 occurring over a given period of time on a bank account. You
                 should receive this periodicaly from your bank.
               </p><p>
-                OpenERP allows you to reconcile a statement line directly with
+                Odoo allows you to reconcile a statement line directly with
                 the related sale or puchase invoices.
               </p>
             </field>
                         </div>
                         <group>
                             <group>
-                                <field name="account_id"/>
+                                <field name="account_id" domain="[('type', 'not in', ['view', 'closed', 'consolidation'])]"/>
                                 <field name="amount_type"/>
-                                <field name="tax_id"/>
+                                <field name="tax_id" domain="[('type_tax_use', 'in', ['purchase', 'all']), ('parent_id', '=', False)]"/>
                             </group>
                             <group>
                                 <field name="label"/>
                 Click to define a new tax code.
               </p><p>
                 Depending on the country, a tax code is usually a cell to fill
-                in your legal tax statement. OpenERP allows you to define the
+                in your legal tax statement. Odoo allows you to define the
                 tax structure and each tax computation will be registered in
                 one or several tax code.
               </p>
                     <field name="debit" sum="Total Debit"/>
                     <field name="credit" sum="Total Credit"/>
                     <field name="date_maturity" invisible="context.get('journal_type', False) not in ['sale','sale_refund','purchase','purchase_refund']"/>
-                    <field name="reconcile"/>
+                    <field name="reconcile_ref"/>
                     <field name="invoice" invisible="1"/>
                     <field name="amount_currency" readonly="True" invisible="not context.get('currency',False)"/>
                     <field name="currency_id" readonly="True" invisible="not context.get('currency',False)" />
                 Select the period and the journal you want to fill.
               </p><p>
                 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
+                entries in Odoo. If you want to record a supplier invoice,
+                start by recording the line of the expense account. Odoo
                 will propose to you automatically the Tax related to this
                 account and the counterpart "Account Payable".
               </p>
                 A journal entry consists of several journal items, each of
                 which is either a debit or a credit transaction.
               </p><p>
-                OpenERP automatically creates one journal entry per accounting
+                Odoo automatically creates one journal entry per accounting
                 document: invoice, refund, supplier payment, bank statements,
                 etc. So, you should record journal entries manually only/mainly
                 for miscellaneous operations.
             <field name="arch" type="xml">
                 <search string="Search Account Templates">
                     <field name="name" filter_domain="['|', ('name','ilike',self), ('code','ilike',self)]" string="Account Template"/>
-                    <filter icon="terp-sale" string="Receivale Accounts" domain="[('type','=','receivable')]"/>
+                    <filter icon="terp-sale" string="Receivable Accounts" domain="[('type','=','receivable')]"/>
                     <filter icon="terp-purchase" string="Payable Accounts" domain="[('type','=','payable')]"/>
                     <field name="parent_id"/>
                     <field name="user_type"/>