Merged with diagram branch
[odoo/odoo.git] / bin / addons / base / res / partner / partner_view.xml
index 37f1c30..1daeb87 100644 (file)
@@ -1,21 +1,25 @@
 <?xml version="1.0" encoding="utf-8"?>
 <openerp>
     <data>
-        <menuitem icon="terp-partner" id="menu_base_partner" name="Partners" sequence="0"/>
+        <menuitem icon="terp-partner" id="menu_base_partner" name="Sales" sequence="0"/>
+        <menuitem id="menu_address_book" name="Address Book" parent="menu_base_partner" sequence="2"/>
+        <menuitem id="menu_base_config" name="Configuration" parent="menu_base_partner" sequence="9"
+            groups="group_system"/>
 
-        <menuitem id="menu_base_config" name="Configuration" parent="menu_base_partner" sequence="1"/>
+        <menuitem id="menu_base_config_partner" name="Partners" parent="menu_base_config" sequence="10" />
+        <menuitem id="menu_base_config_contact" name="Contacts" parent="menu_base_config" sequence="20" />
 
         <!--
-    ================================
-    Function
-    ================================
-    -->
+          ================================
+          Function
+          ================================
+        -->
         <record id="view_partner_function_form" model="ir.ui.view">
             <field name="name">res.partner.function.form</field>
             <field name="model">res.partner.function</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
-                <form string="Partner Functions">
+                <form string="Contact Functions">
                     <field name="name" select="1"/>
                     <field name="code" select="1"/>
                 </form>
             <field name="model">res.partner.function</field>
             <field name="type">tree</field>
             <field name="arch" type="xml">
-                <tree string="Partner Functions">
+                <tree string="Contact Functions">
                     <field name="code"/>
                     <field name="name"/>
                 </tree>
             </field>
         </record>
         <record id="action_partner_function_form" model="ir.actions.act_window">
-            <field name="name">Partner Functions</field>
+            <field name="name">Contact Functions</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">res.partner.function</field>
             <field name="view_type">form</field>
         </record>
-        <menuitem action="action_partner_function_form" id="menu_partner_function_form" parent="base.menu_base_config"/>
+        <menuitem action="action_partner_function_form" id="menu_partner_function_form" parent="base.menu_base_config_contact" sequence="20"/>
 
         <!--
-    =====================
-    Partner Address
-    =====================
-    -->
+          =====================
+          Partner Address
+          =====================
+        -->
+
+        <record id="view_res_partner_address_filter" model="ir.ui.view">
+            <field name="name">res.partner.address.select</field>
+            <field name="model">res.partner.address</field>
+            <field name="type">search</field>
+            <field name="arch" type="xml">
+                <search string="Search Contact">
+                    <field name="name" select='1'/>
+                    <field name="partner_id" select='1'/>
+                    <field name="country_id" select='1'/>
+                </search>
+            </field>
+        </record>
+
         <record id="view_partner_address_tree" model="ir.ui.view">
             <field name="name">res.partner.address.tree</field>
             <field name="model">res.partner.address</field>
@@ -53,6 +71,8 @@
                 <tree string="Partner Addresses">
                     <field name="partner_id"/>
                     <field name="name"/>
+                    <field name="type"/>
+                    <field name="street"/>
                     <field name="zip"/>
                     <field name="city"/>
                     <field name="country_id"/>
@@ -60,7 +80,7 @@
             </field>
         </record>
         <record id="action_partner_addess_tree" model="ir.actions.act_window">
-            <field name="name">Partner contacts</field>
+            <field name="name">Partner Contacts</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">res.partner.address</field>
             <field name="view_type">tree</field>
             <field name="type">form</field>
             <field eval="8" name="priority"/>
             <field name="arch" type="xml">
-                <form string="Partner Address">
-                    <field colspan="4" name="partner_id" select="1"/>
-                    <newline/>
-                    <field name="name" select="1"/>
-                    <field domain="[('domain', '=', 'contact')]" name="title"/>
-                    <field name="function"/>
-                    <field name="type" select="2"/>
-                    <field name="street" select="2"/>
-                    <field name="street2"/>
-                    <newline/>
-                    <field name="zip" select="2"/>
-                    <field name="city" select="2"/>
-                    <newline/>
-                    <field completion="1" name="country_id" select="1"/>
-                    <field name="state_id" select="2"/>
-                    <newline/>
-                    <field name="phone" select="2"/>
-                    <field name="fax"/>
-                    <newline/>
-                    <field name="mobile" select="2"/>
-                    <field name="email" select="2"/>
+                <form string="Address">
+                    <group colspan="4" col="6">
+                        <field name="partner_id" colspan="2"/>
+                        <field name="company_id" groups="base.group_multi_company" widget="selection" colspan="2"/>
+                        <newline/>
+                        <field name="name"/>
+                        <field domain="[('domain', '=', 'contact')]" name="title"/>
+                        <field name="function"/>
+                    </group>
+                      <group colspan="2" col="2">
+                        <separator string="Postal Address" colspan="4" col="4"/>
+                        <field name="type"/>
+                        <field name="street"/>
+                        <field name="street2"/>
+                        <field name="zip"/>
+                        <field name="city"/>
+                        <field name="country_id"/>
+                        <field name="state_id"/>
+                      </group>
+                      <group colspan="2" col="2">
+                        <separator string="Communication" colspan="4" col="4"/>
+                        <field name="phone"/>
+                        <field name="fax"/>
+                        <field name="mobile"/>
+                        <field name="email" widget="email"/>
+                     </group>
                 </form>
             </field>
         </record>
         <record id="action_partner_address_form" model="ir.actions.act_window">
-            <field name="name">Partner Addresses</field>
+            <field name="name">Addresses</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">res.partner.address</field>
             <field name="view_type">form</field>
+            <field name="search_view_id" ref="view_res_partner_address_filter"/>
         </record>
         <record id="action_partner_address_form_view1" model="ir.actions.act_window.view">
             <field eval="10" name="sequence"/>
             <field name="view_id" ref="view_partner_address_form1"/>
             <field name="act_window_id" ref="action_partner_address_form"/>
         </record>
-        <menuitem action="action_partner_address_form" id="menu_partner_address_form" parent="base.menu_base_partner"/>
+        <menuitem action="action_partner_address_form" id="menu_partner_address_form" parent="base.menu_address_book" sequence="30"/>
 
         <!--
-    =========================================
-    the short form used in the partner form
-    =========================================
-    -->
+          =========================================
+          the short form used in the partner form
+          =========================================
+        -->
         <record id="view_partner_address_form2" model="ir.ui.view">
             <field name="name">res.partner.address.form2</field>
             <field name="model">res.partner.address</field>
                     <field domain="[('domain', '=', 'contact')]" name="title"/>
                     <field name="street"/>
                     <field name="street2"/>
-                    <field name="type" select="2"/>
+                    <field name="type"/>
                     <field name="function"/>
+                    <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                     <newline/>
-                    <field name="zip" select="2"/>
-                    <field name="city" select="2"/>
+                    <field name="zip"/>
+                    <field name="city"/>
                     <newline/>
                     <field completion="1" name="country_id" select="1"/>
-                    <field name="state_id" select="2"/>
+                    <field name="state_id"/>
                     <newline/>
                     <field name="phone"/>
                     <field name="fax"/>
                     <newline/>
                     <field name="mobile"/>
-                    <field name="email"/>
+                    <field name="email" widget="email"/>
                 </form>
             </field>
         </record>
 
         <!--
-    =======================
-    Partner Titles
-    =======================
-    -->
+          =======================
+          Partner Titles
+          =======================
+        -->
+        <record id="view_partner_title_tree" model="ir.ui.view">
+            <field name="name">res.partner.title.tree</field>
+            <field name="model">res.partner.title</field>
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <tree string="Partner Titles">
+                    <field name="name" select="1"/>
+                    <field name="shortcut" select="1"/>
+                </tree>
+            </field>
+        </record>
         <record id="view_partner_title_form" model="ir.ui.view">
             <field name="name">res.partner.title.form</field>
             <field name="model">res.partner.title</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
-                <form string="Partners Titles">
+                <form string="Partner Titles">
                     <field name="name" select="1"/>
                     <field name="shortcut" select="1"/>
                     <field name="domain"/>
                 </form>
             </field>
         </record>
+
+        <!--
         <record id="action_partner_title" model="ir.actions.act_window">
-            <field name="name">Partners Titles</field>
+            <field name="name">Titles</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">res.partner.title</field>
             <field name="view_type">form</field>
         </record>
         <menuitem action="action_partner_title" id="menu_partner_title" parent="base.menu_base_config"/>
+        -->
+
+        <record id="action_partner_title_partner" model="ir.actions.act_window">
+            <field name="name">Partner Titles</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">res.partner.title</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('domain','=','partner')]</field>
+        </record>
+        <menuitem action="action_partner_title_partner" id="menu_partner_title_partner" parent="menu_base_config_partner" sequence="10"/>
+
+        <record id="action_partner_title_contact" model="ir.actions.act_window">
+            <field name="name">Contact Titles</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">res.partner.title</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('domain','=','contact')]</field>
+        </record>
+        <menuitem action="action_partner_title_contact" id="menu_partner_title_contact" parent="menu_base_config_contact" sequence="10"/>
 
         <!--
-    =======================
-    Partner
-    =======================
-    -->
+          =======================
+          Partner
+          =======================
+        -->
         <record id="view_partner_tree" model="ir.ui.view">
             <field name="name">res.partner.tree</field>
             <field name="model">res.partner</field>
             <field name="arch" type="xml">
                 <tree string="Partners">
                     <field name="name"/>
+                    <field name="ref"/>
+                    <field name="phone"/>
                     <field name="city"/>
                     <field name="country"/>
-                    <field name="title" string="Type"/>
-                    <field name="ref"/>
-                    <field name="address" string="# of Contacts"/>
                     <field name="lang"/>
+                    <field name="user_id"/>
                 </tree>
             </field>
         </record>
+
         <record id="view_partner_form" model="ir.ui.view">
             <field name="name">res.partner.form</field>
             <field name="model">res.partner</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
-                <form string="Partners">
-                    <group colspan="4" col="6">
-                        <field name="name" select="1"/>
-                        <field name="ref" select="1"/>
-                        <field name="customer" select="1"/>
-                        <field domain="[('domain', '=', 'partner')]" name="title"/>
-                        <field name="lang" select="2"/>
-                        <field name="supplier" select="2"/>
-                        <field name="city" select="2" />
-                           <field name="country" select="2" />
+                <form string="Partners" col='1'>
+                    <group col="6" colspan="4">
+                        <group colspan="5" col="6">
+                            <field name="name" select="1"/>
+                            <field name="ref"/>
+                            <field domain="[('domain', '=', 'partner')]" name="title"/>
+                            <field name="lang"/>
+                        </group>
+                        <group colspan="1" col="2">
+                            <field name="customer" select="1"/>
+                            <field name="supplier"/>
+                        </group>
                     </group>
                     <notebook colspan="4">
                         <page string="General">
-                            <field colspan="4" mode="form,tree" name="address" nolabel="1" select="1">
-                                <form string="Partner contacts">
-                                    <field name="name" select="2"/>
-                                    <field domain="[('domain', '=', 'contact')]" name="title" string="Type"/>
-                                    <field name="function"/>
-                                    <field name="type" select="2"/>
-                                    <field name="street" select="2"/>
-                                    <field name="street2"/>
-                                    <newline/>
-                                    <field name="zip" select="2"/>
-                                    <field name="city" select="2"/>
-                                    <newline/>
-                                    <field completion="1" name="country_id" select="2"/>
-                                    <field name="state_id" select="2"/>
-                                    <newline/>
-                                    <field name="phone"/>
-                                    <field name="fax"/>
+                            <field colspan="4" mode="form,tree" name="address" nolabel="1" select="1" height="260">
+                                <form string="Partner Contacts">
+                                    <group colspan="4" col="6">
+                                        <field name="name"/>
+                                        <field domain="[('domain', '=', 'contact')]" name="title" size="0"/>
+                                        <field name="function"/>
+                                    </group>
                                     <newline/>
-                                    <field name="mobile"/>
-                                    <field name="email" select="2" widget="email"/>
+                                      <group colspan="2" col="4">
+                                        <separator string="Postal Address" colspan="4" col="4" />
+                                        <field name="type" string="Type" colspan="2"/>
+                                        <field name="street" colspan="4"/>
+                                        <field name="street2" colspan="4"/>
+                                        <field name="zip"/>
+                                        <field name="city"/>
+                                        <field name="country_id" completion="1"/>
+                                        <field name="state_id"/>
+                                     </group>
+                                     <group colspan="2" col="2">
+                                        <separator string="Communication" colspan="2" col="2" />
+                                        <field name="phone"/>
+                                        <field name="mobile"/>
+                                        <field name="fax"/>
+                                        <field name="email" widget="email"/>
+                                     </group>
                                 </form>
-                                <tree string="Partner contacts">
+                                <tree string="Partner Contacts">
                                     <field name="name"/>
                                     <field name="zip"/>
                                     <field name="city"/>
                                     <field name="country_id"/>
+                                    <field name="phone"/>
+                                    <field name="email"/>
                                 </tree>
                             </field>
                             <separator colspan="4" string="Categories"/>
-                            <field colspan="4" name="category_id" nolabel="1" select="2"/>
+                            <field colspan="4" name="category_id" nolabel="1" height="90"/>
                         </page>
                         <page string="Sales &amp; Purchases">
                             <separator string="General Information" colspan="4"/>
-                            <field name="user_id" select="2"/>
-                            <field name="active" select="2"/>
+                            <field name="user_id"/>
+                            <field name="active"/>
                             <field name="website" widget="url"/>
-                            <field name="date" select="2"/>
+                            <field name="date"/>
                             <field name="parent_id"/>
+                            <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                             <newline/>
                         </page>
                         <page string="History">
             </field>
         </record>
 
+       <record id="view_res_partner_filter" model="ir.ui.view">
+            <field name="name">res.partner.select</field>
+            <field name="model">res.partner</field>
+            <field name="type">search</field>
+            <field name="arch" type="xml">
+                <search string="Search Partner">
+                   <group col='10' colspan='4'>
+                        <filter string="My Partners" icon="terp-partner" domain="[('user_id','=',uid)]"/>
+                        <separator orientation="vertical"/>
+                        <filter string="Customers" icon="terp-partner" domain="[('customer','=',1)]" help="Customer Partners"/>
+                        <filter string="Suppliers" icon="terp-partner" domain="[('supplier','=',1)]" help="Supplier Partners"/>
+                        <separator orientation="vertical"/>
+                        <field name="name" select="1"/>
+                        <field name="address" select="1"/>
+                        <field name="country" select="1"/>
+                        <field name="category_id" select="1"/>
+                        <field name="user_id" select="1"/>
+                   </group>
+               </search>
+            </field>
+        </record>
+
         <record id="action_partner_form" model="ir.actions.act_window">
             <field name="name">Partners</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">res.partner</field>
             <field name="view_type">form</field>
+            <field name="context">{"search_default_supplier":supplier}</field>
+            <field name="search_view_id" ref="view_res_partner_filter"/>
         </record>
         <record id="action_partner_form_view1" model="ir.actions.act_window.view">
             <field eval="10" name="sequence"/>
         <menuitem
             action="action_partner_form"
             id="menu_partner_form"
-            parent="base.menu_base_partner"
+            parent="base.menu_address_book"
             sequence="2"/>
 
         <record id="action_partner_customer_form" model="ir.actions.act_window">
-            <field name="name">Customers Partners</field>
+            <field name="name">Customers</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">res.partner</field>
             <field name="view_type">form</field>
             <field name="domain">[('customer','=',1)]</field>
+            <field name="context">{'default_customer':1}</field>
+            <field name="filter" eval="True"/>
         </record>
-        <menuitem action="action_partner_customer_form" id="menu_partner_customer_form" parent="menu_partner_form"/>
+
         <record id="action_partner_supplier_form" model="ir.actions.act_window">
-            <field name="name">Suppliers Partners</field>
+            <field name="name">Suppliers</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">res.partner</field>
             <field name="view_type">form</field>
             <field name="domain">[('supplier','=',1)]</field>
+            <field name="context">{'default_customer':0, 'default_supplier':1}</field>
+            <field name="filter" eval="True"/>
         </record>
-        <menuitem action="action_partner_supplier_form" id="menu_partner_supplier_form" parent="menu_partner_form"/>
+
         <record id="action_partner_other_form" model="ir.actions.act_window">
-            <field name="name">Others Partners</field>
+            <field name="name">Other Partners</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">res.partner</field>
             <field name="view_type">form</field>
             <field name="domain">[('supplier','&lt;&gt;',1),('customer','&lt;&gt;',1)]</field>
+            <field name="filter" eval="True"/>
         </record>
-        <menuitem action="action_partner_other_form" id="menu_partner_other_form" parent="menu_partner_form"/>
+
         <record id="action_partner_customer_form_new" model="ir.actions.act_window">
             <field name="name">New Partner</field>
             <field name="type">ir.actions.act_window</field>
             <field name="res_model">res.partner</field>
             <field name="view_type">form</field>
             <field name="view_mode">form,tree</field>
+            <field name="view_id" ref="view_partner_form"/>
         </record>
-        <menuitem action="action_partner_customer_form_new" id="menu_partner_customer_form_new" parent="menu_partner_form"/>
 
         <record id="view_payterm_form" model="ir.ui.view">
             <field name="name">res.payterm</field>
             <field name="model">res.payterm</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
-                <form string="Payment term">
+                <form string="Payment Term">
                     <field colspan="4" name="name"/>
                 </form>
             </field>
             <field name="type">form</field>
             <field name="arch" type="xml">
                 <form string="Bank account">
-                    <field name="state" select="2"/>
+                    <field name="state"/>
                     <field name="partner_id" select="1"/>
                     <newline/>
                     <field name="acc_number" select="1"/>
                     <newline/>
                     <field name="sequence"/>
                     <field colspan="4" name="name"/>
-                    <separator colspan="4" string="Bank account owner"/>
-                    <field colspan="4" name="owner_name" select="2"/>
+                    <separator colspan="4" string="Bank Account Owner"/>
+                    <field colspan="4" name="owner_name"/>
                     <field colspan="4" name="street"/>
                     <field name="city"/>
                     <field name="zip"/>
-                    <field completion="1" name="country_id" select="2"/>
-                    <field name="state_id" select="2"/>
+                    <field completion="1" name="country_id"/>
+                    <field name="state_id"/>
                 </form>
             </field>
         </record>
             <field name="model">res.partner.bank</field>
             <field name="type">tree</field>
             <field name="arch" type="xml">
-                <tree string="Bank accounts">
+                <tree string="Bank Accounts">
                     <field name="state"/>
                     <field name="acc_number"/>
                     <field name="partner_id"/>
         </record>
 
         <!--
-    ======================
-    Company Architecture
-    ======================
-    -->
+          ======================
+          Company Architecture
+          ======================
+        -->
         <record id="view_partner_tree2" model="ir.ui.view">
             <field name="name">res.partner.tree</field>
             <field name="model">res.partner</field>
         </record>
 
         <!--
-    ======================
-    Categories
-    ======================
-    -->
+          ======================
+          Categories
+          ======================
+        -->
         <record id="view_partner_category_form" model="ir.ui.view">
             <field name="name">res.partner.category.form</field>
             <field name="model">res.partner.category</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
-                <form string="Partner category">
+                <form string="Partner Category">
                     <field name="name" select="1"/>
                     <field name="active" select="1"/>
                     <field name="parent_id"/>
+                    <separator colspan="4" string="Partners"/>
+                    <field colspan="4" name="partner_ids" nolabel="1"/>
                 </form>
             </field>
         </record>
             <field name="arch" type="xml">
                 <tree string="Partner Categories">
                     <field name="complete_name"/>
+                    <field name="active" />
                 </tree>
             </field>
         </record>
             <field name="type">tree</field>
             <field name="field_parent">child_ids</field>
             <field name="arch" type="xml">
-                <tree string="Partner Categories">
+                <tree toolbar="1" string="Partner Categories">
                     <field name="name"/>
                 </tree>
             </field>
             <field name="view_id" ref="view_partner_category_tree"/>
             <field name="domain">[('parent_id','=',False)]</field>
         </record>
-        <menuitem action="action_partner_category" id="menu_partner_category_main" parent="base.menu_base_partner" sequence="1"/>
+        <menuitem action="action_partner_category" id="menu_partner_category_main" parent="base.menu_address_book" sequence="1"/>
 
         <record id="action_partner_by_category" model="ir.actions.act_window">
-            <field name="name" eval="False"/>
+            <field name="name">Partner Categories</field>
             <field name="res_model">res.partner</field>
             <field name="view_type">form</field>
             <field name="view_mode">tree,form</field>
             <field name="domain">[('category_id','child_of', [active_id])]</field>
             <field name="context">{'category_id':active_id}</field>
+            <field name="search_view_id" ref="view_res_partner_filter"/>
         </record>
+
         <record id="ir_action_partner_by_category" model="ir.values">
             <field eval="'tree_but_open'" name="key2"/>
             <field eval="'res.partner.category'" name="model"/>
             <field name="res_model">res.partner.category</field>
             <field name="view_type">form</field>
         </record>
-        <menuitem action="action_partner_category_form" id="menu_partner_category_form" parent="base.menu_base_config"/>
+        <menuitem action="action_partner_category_form" id="menu_partner_category_form" parent="base.menu_base_config_partner"/>
+
+        <act_window domain="[('partner_id', '=', active_id)]"
+            id="act_res_partner_event" name="Events"
+            res_model="res.partner.event"
+            src_model="res.partner"/>
 
     </data>
 </openerp>