[MERGE] forward port of branch 7.0 up to 3a0af6a
[odoo/odoo.git] / addons / sale / res_partner_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4         <record id="act_res_partner_2_sale_order" model="ir.actions.act_window">
5             <field name="name">Quotations and Sales</field>
6             <field name="res_model">sale.order</field>
7             <field name="view_type">form</field>
8             <field name="view_mode">tree,form,graph</field>
9             <field name="context">{'search_default_partner_id': active_id}</field>
10             <field name="groups_id" eval="[(4, ref('base.group_sale_salesman'))]"/>
11             <field name="help" type="html">
12               <p class="oe_view_nocontent_create">
13                 Click to create a quotation or sales order for this customer.
14               </p><p>
15                 OpenERP will help you efficiently handle the complete sale flow:
16                 quotation, sales order, delivery, invoicing and
17                 payment.
18               </p><p>
19                 The social feature helps you organize discussions on each sales
20                 order, and allow your customer to keep track of the evolution
21                 of the sales order.
22               </p>
23             </field>
24         </record>
25
26         <!-- Partner kanban view inherte -->
27         <record model="ir.ui.view" id="crm_lead_partner_kanban_view">
28             <field name="name">res.partner.kanban.saleorder.inherit</field>
29             <field name="model">res.partner</field>
30             <field name="inherit_id" ref="base.res_partner_kanban_view"/>
31             <field name="priority" eval="20"/>
32             <field name="arch" type="xml">
33                 <field name="mobile" position="after">
34                     <field name="sale_order_count"/>
35                 </field>
36                 <xpath expr="//div[@class='oe_kanban_partner_links']" position="inside">
37                     <a name="%(sale.act_res_partner_2_sale_order)d" type="action" t-if="record.sale_order_count.value>0">
38                         <t t-esc="record.sale_order_count.value"/> Sales
39                     </a>
40                 </xpath>
41             </field>
42         </record>
43
44         <record id="res_partner_view_buttons" model="ir.ui.view">
45             <field name="name">res.partner.view.buttons</field>
46             <field name="model">res.partner</field>
47             <field name="inherit_id" ref="base.view_partner_form" />
48             <field name="priority" eval="20"/>
49             <field name="arch" type="xml">
50                 <xpath expr="//div[@name='buttons']" position="inside">
51                     <button name="%(sale.act_res_partner_2_sale_order)d" type="action"
52                         string="Quotations and Sales"
53                         attrs="{'invisible': [('customer', '=', False)]}"
54                         groups="base.group_sale_salesman"/>
55                 </xpath>
56             </field>
57         </record>
58
59         <record id="res_partner_address_type" model="ir.ui.view">
60             <field name="name">res.partner.view.address_type</field>
61             <field name="model">res.partner</field>
62             <field name="inherit_id" ref="base.view_partner_form" />
63             <field name="arch" type="xml">
64                 <xpath expr="//label[@for='type']" position="attributes">
65                     <attribute name="groups">sale.group_delivery_invoice_address</attribute>
66                     <attribute name="invisible">False</attribute>
67                 </xpath>
68                 <xpath expr="//div[@name='div_type']" position="attributes">
69                     <attribute name="invisible">False</attribute>
70                     <attribute name="groups">sale.group_delivery_invoice_address</attribute>
71                 </xpath>
72                 <!--  Version-specific hacks to avoid breaking view inheritance when the sale module
73                       is installed on top of an older 7.0 version of the base module
74                       (as the second embedded div_type was added later in the 7.0 release)
75                       TODO: remove the hacks in trunk -->
76                 <xpath expr="//div[@name='div_type'][field[@name='use_parent_address']] | //field[@name='child_ids']//div[@name='div_type']" position="attributes">
77                     <attribute name="invisible">False</attribute>
78                     <attribute name="groups">sale.group_delivery_invoice_address</attribute>
79                 </xpath>
80                 <xpath expr="//label[@for='type'][following-sibling::div[@name='div_type']/field[@name='use_parent_address']] | //field[@name='child_ids']//label[@for='type']" position="attributes">
81                     <attribute name="invisible">False</attribute>
82                     <attribute name="groups">sale.group_delivery_invoice_address</attribute>
83                 </xpath>
84             </field>
85         </record>
86
87     </data>
88 </openerp>
89