[FIX] Fixed sidebar padding problem
[odoo/odoo.git] / addons / account_payment / account_payment_view.xml
index 4fe86cf..3fc2d71 100644 (file)
                     <field name="amount_to_pay"/>
                     <field name="amount_currency"/>
                     <field name="currency_id"/>
+                    <field name="period_id" invisible="1"/>
                 </tree>
             </field>
         </record>
 
-        <menuitem id="menu_main" name="Payment" parent="account.menu_finance" sequence="6"/>
+        <menuitem id="menu_main_payment" name="Payment" parent="account.menu_finance" sequence="7"/>
 
-        <record id="view_payment_type_form" model="ir.ui.view">
-            <field name="name">payment.type.form</field>
-            <field name="model">payment.type</field>
-            <field name="type">form</field>
+        <record id="view_payment_mode_search" model="ir.ui.view">
+            <field name="name">payment.mode.search</field>
+            <field name="model">payment.mode</field>
+            <field name="type">search</field>
             <field name="arch" type="xml">
-                               <form string="Payment Type">
+                <search string="Payment Mode">
                     <field name="name"/>
-                    <field name="code"/>
-                    <separator string="Suitable Bank Types" colspan="4"/>
-                    <field name="suitable_bank_types" nolabel="1"  colspan="4"/>
-                </form>
+                    <field name="journal" widget='selection'/>
+                    <field name="company_id" widget='selection' groups="base.group_multi_company"/>
+                    <newline/>
+                    <group expand="0" string="Group By...">
+                      <filter string="Journal" icon="terp-folder-orange" domain="[]" context="{'group_by':'journal'}"/>
+                    </group>
+                </search>
             </field>
         </record>
 
-        <record id="action_payment_type_tree" model="ir.actions.act_window">
-            <field name="name">Payment Type</field>
-            <field name="res_model">payment.type</field>
-            <field name="view_type">form</field>
-            <field name="view_mode">tree,form</field>
-        </record>
-
         <record id="view_payment_mode_tree" model="ir.ui.view">
             <field name="name">payment.mode.tree</field>
             <field name="model">payment.mode</field>
                 <tree string="Payment Mode">
                     <field name="name"/>
                     <field name="journal"/>
-                    <field name="company_id"/>
+                    <field name="company_id" groups="base.group_multi_company"/>
                 </tree>
             </field>
         </record>
+
         <record id="view_payment_mode_form" model="ir.ui.view">
             <field name="name">payment.mode.form</field>
             <field name="model">payment.mode</field>
             <field name="arch" type="xml">
                 <form string="Payment Mode">
                     <field name="name" select="1"/>
-                    <field name="type"/>
-                    <field name="journal"/>
-                    <field name="bank_id"/>
-                    <field name="company_id" select="1" widget='selection'/>
+                    <field name="journal" select="1"/>
+                    <field name="bank_id" domain="[('partner_id','=',partner_id)]"  />
+                    <field name="company_id" select="1" widget='selection' groups="base.group_multi_company" on_change="onchange_company_id(company_id)"/>
+                    <field name="partner_id" select="1" widget='selection' invisible="1"/>
                 </form>
             </field>
         </record>
             <field name="res_model">payment.mode</field>
             <field name="view_type">form</field>
             <field name="view_mode">tree,form</field>
+            <field name="search_view_id" ref="view_payment_mode_search"/>
         </record>
 
-        <menuitem id="next_id_44" name="Payment" parent="account.menu_finance_configuration" groups="base.group_system"/>
-
-        <menuitem action="action_payment_mode_form" id="menu_action_payment_mode_form" parent="next_id_44"/>
-
-        <menuitem action="action_payment_type_tree" id="menu_action_paymen_type" parent="next_id_44"/>
+        <menuitem action="action_payment_mode_form" id="menu_action_payment_mode_form" parent="account.menu_configuration_misc"/>
 
         <record id="view_payment_order_form" model="ir.ui.view">
             <field name="name">payment.order.form</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
                 <form string="Payment order">
-                    <field name="reference"/>
-                    <field name="mode"/>
-                    <field name="date_prefered"/>
-                    <field name="date_planned" select="1"/>
-                    <field name="user_id"/>
-                    <button colspan="2" name="%(action_create_payment_order)d" string="Select Invoices to Pay" type="action" attrs="{'invisible':[('state','=','done')]}" icon="gtk-find"/>
-                    <field name="line_ids" colspan="4" widget="one2many_list" nolabel="1">
+                    <group col="6" colspan="4">
+                      <field name="reference"/>
+                      <field name="mode" widget='selection'/>
+                      <field name="user_id"/>
+                      <field name="date_prefered"/>
+                      <field name="date_scheduled" select="1" attrs="{'readonly':[('date_prefered','!=','fixed')]}" />
+                      <button colspan="2" name="%(action_create_payment_order)d" string="Select Invoices to Pay" type="action" attrs="{'invisible':[('state','=','done')]}" icon="gtk-find"/>
+                      <field name="company_id" widget='selection' groups="base.group_multi_company"/>
+                    </group>
+                    <field name="line_ids" colspan="4" widget="one2many_list" nolabel="1" default_get="{'order_id': active_id or False}" >
                         <form string="Payment Line">
                             <notebook>
                                 <page string="Payment">
-                                    <field name="move_line_id" on_change="onchange_move_line(move_line_id,parent.mode,parent.date_prefered,parent.date_planned,currency,company_currency)" select="1" domain="[('reconcile_id','=', False), ('credit', '>',0),('amount_to_pay','>',0)] "/>
+                                    <field name="move_line_id" on_change="onchange_move_line(move_line_id,parent.mode,parent.date_prefered,parent.date_scheduled,currency,company_currency)" select="1" domain="[('reconcile_id','=', False), ('credit', '>',0),('amount_to_pay','>',0)] "/>
                                     <separator colspan="4" string="Transaction Information"/>
                                     <field name="date"/>
                                     <group colspan="2">
                                     <field colspan="4" name="communication"/>
                                     <field colspan="4" name="communication2"/>
                                     <field name="name"/>
-                                     <field name="state"/>
+                                    <field name="state"/>
+                                    <field name="company_id" widget='selection' groups="base.group_multi_company"/>
                                 </page>
                                 <page string="Information">
 
                         <tree string="Payment Line">
                             <field name="ml_inv_ref" />
                             <field name="partner_id" select="1"/>
+                            <field name="communication"/>
                             <field name="bank_id" domain="[('partner_id', '=', partner_id)]"/>
                             <field name="ml_maturity_date"/>
                             <field name="date"/>
                     <group col="4" colspan="2">
                          <button name="cancel" states="draft,open" string="Cancel" icon="gtk-cancel"/>
                          <button name="open" states="draft" string="Confirm Payments"  icon="gtk-apply"/>
-                         <button name="%(action_account_payment_make_payment)d" states="open" string="Make Payments" type="action" icon="gtk-execute"/>
+                         <button name="set_done" states="open" string="Make Payments" type="object" icon="gtk-execute"/>
                          <button name="set_to_draft" states="cancel" string="Set to draft" type="object" icon="gtk-convert"/>
                     </group>
                 </form>
             <field name="type">tree</field>
             <field eval="4" name="priority"/>
             <field name="arch" type="xml">
-                <tree colors="blue:state in ('draft');gray:state in ('cancel','done');black:state in ('open')" editable="bottom" string="Payment order">
+                <tree colors="blue:state == 'draft';gray:state in ('cancel','done');black:state == 'open'" string="Payment order">
                     <field name="reference"/>
                     <field name="mode"/>
-                    <field name="date_planned"/>
+                    <field name="user_id"/>
+                    <field name="company_id" groups="base.group_multi_company"/>
                     <field name="date_created"/>
                     <field name="date_done"/>
                     <field name="total"/>
                     <field name="state"/>
+                    <button name="cancel" states="draft,open" string="Cancel" icon="gtk-cancel"/>
+                    <button name="open" states="draft" string="Confirm Payments"  icon="gtk-apply"/>
+                    <button name="set_done" states="open" string="Make Payments"  type ="object" icon="gtk-execute"/>
                 </tree>
             </field>
         </record>
 
+        <record id="view_payment_order_search" model="ir.ui.view">
+            <field name="name">payment.order.tree.search</field>
+            <field name="model">payment.order</field>
+            <field name="type">search</field>
+            <field name="arch" type="xml">
+                <search string="Search Payment Orders">
+                    <group>
+                        <filter string="Draft" domain="[('state','=','draft')]" icon="terp-document-new"/>
+                        <filter string="Confirmed" domain="[('state','=','open')]" icon="terp-camera_test"/>
+                        <filter string="Done" domain="[('state','=','done')]" icon="terp-dialog-close"/>
+                        <separator orientation="vertical"/>
+                        <field name="reference"/>
+                        <field name="mode" widget='selection'/>
+                        <field name="date_done"/>
+                        <field name="state"/>
+                    </group>
+                    <newline/>
+                    <group expand="0" string="Group By...">
+                        <filter string="Payment Mode" context="{'group_by': 'mode'}" icon="terp-dolar"/>
+                        <filter string="State" context="{'group_by': 'state'}" icon="terp-stock_effects-object-colorize"/>
+                    </group>
+                </search>
+            </field>
+        </record>
+
         <record id="action_payment_order_tree" model="ir.actions.act_window">
             <field name="name">Payment Orders</field>
             <field name="res_model">payment.order</field>
             <field name="view_type">form</field>
             <field name="view_mode">tree,form</field>
+            <field name="search_view_id" ref="view_payment_order_search"/>
+            <field name="help">A payment order is a payment request from your company to pay a supplier invoice or a customer credit note. Here you can register all payment orders that should be done, keep track of all payment orders and mention the invoice reference and the partner the payment should be done for.</field>
         </record>
-        <menuitem action="action_payment_order_tree" id="menu_action_payment_order_form" parent="account_payment.menu_main" sequence="3"/>
 
-        <record id="action_payment_order_draft" model="ir.actions.act_window">
-            <field name="name">Draft Payment Order</field>
-            <field name="res_model">payment.order</field>
-            <field name="view_type">form</field>
-            <field name="view_mode">tree,form</field>
-            <field name="domain">[('state','=','draft')]</field>
-            <field name="filter" eval="True"/>
-        </record>
+        <menuitem action="action_payment_order_tree" id="menu_action_payment_order_form" parent="menu_main_payment" sequence="3"/>
 
-        <record id="action_payment_order_open" model="ir.actions.act_window">
-            <field name="name">Payment Orders to Approve</field>
-            <field name="res_model">payment.order</field>
-            <field name="view_type">form</field>
-            <field name="view_mode">tree,form</field>
-            <field name="domain">[('state','=','open')]</field>
-            <field name="filter" eval="True"/>
-        </record>
         <record id="action_payment_order_tree_new" model="ir.actions.act_window">
             <field name="name">New Payment Order</field>
             <field name="res_model">payment.order</field>
                             <separator colspan="4" string="Transaction Information"/>
                             <field name="date"/>
                             <group colspan="2">
-                                <field name="amount_currency" on_change="onchange_amount(amount_currency,currency,comapny_currency)"/>
+                                <field name="amount_currency" on_change="onchange_amount(amount_currency,currency,company_currency)"/>
                                 <field name="currency" nolabel="1"/>
                             </group>
                             <field name="partner_id" on_change="onchange_partner(partner_id, False)" select="1"/>
                              <field name="state"/>
                         </page>
                         <page string="Information">
-
                             <separator colspan="4" string="General Information"/>
                             <group colspan="2">
                                 <field name="amount" select="1"/>
                     <field name="ml_inv_ref" />
                     <field name="ml_maturity_date"/>
                     <field name="partner_id" select="1"/>
+                    <field name="communication"/>
                     <field name="amount" sum="Amount Total"/>
                     <field name="amount_currency" sum="Currency Amount Total"/>
                     <field name="currency"/>
             <field name="type">form</field>
             <field name="inherit_id" ref="account.view_bank_statement_form"/>
             <field name="arch" type="xml">
-                <group col="7" colspan="4" position="inside">
-                    <button  colspan="2" name="%(action_account_populate_statement_confirm)d" string="Import payment lines" type="action" icon="gtk-open"/>
-                </group>
+                <field name="journal_id" position="after">
+                    <button name="%(action_account_populate_statement_confirm)d" attrs="{'invisible':[('state','=','confirm')]}" string="Import payment lines" type="action" icon="gtk-execute"/>
+                </field>
             </field>
         </record>
 
-        <act_window domain="[('move_line_id.move_id.id', '=', move_id)]" id="act_account_invoice_2_payment_line" name="Payment Lines" res_model="payment.line" src_model="account.invoice"/>
-
     </data>
 </openerp>