75afa81ba1ea69be9580394fcbb0c217879fb2d4
[odoo/odoo.git] / addons / portal / portal_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5         <!-- menu Administration/Portals/Portals -->
6         <record id="portal_list_action" model="ir.actions.act_window">
7             <field name="name">Portals</field>
8             <field name="res_model">res.portal</field>
9             <field name="view_type">form</field>
10             <field name="view_mode">tree,form</field>
11             <!-- a context is necessary to get the right portal form view -->
12             <field name="context">{'form_view_ref': 'portal.portal_form_view'}</field>
13             <field name="help">
14 A portal helps defining specific views and rules for a group of users (the
15 portal group).  A portal menu, widgets and specific groups may be assigned to
16 the portal's users.
17             </field>
18         </record>
19
20         <menuitem name="Portals" id="portal_list_menu"
21             parent="portal_menu_settings" sequence="1" action="portal_list_action"/>
22
23         <!-- portal tree view -->
24         <record id="portal_list_view" model="ir.ui.view">
25             <field name="name">Portal List</field>
26             <field name="model">res.portal</field>
27             <field name="type">tree</field>
28             <field name="arch" type="xml">
29                 <tree string="Portals">
30                     <field name="name" string="Portal Name"/>
31                 </tree>
32             </field>
33         </record>
34
35         <!-- portal form view -->
36         <record id="portal_form_view" model="ir.ui.view">
37             <field name="name">Portal Form</field>
38             <field name="model">res.portal</field>
39             <field name="type">form</field>
40             <field name="inherit_id" ref="base.view_groups_form"/>
41             <field name="arch" type="xml">
42                 <page string="Users" position="before">
43                     <page string="Portal">
44                         <group colspan="4" col="2">
45                             <separator string="Website" colspan="2"/>
46                             <field name="url" widget="url"/>
47                         </group>
48                         <group colspan="2" col="2">
49                             <separator string="Widgets assigned to Users" colspan="2"/>
50                             <field name="widget_ids" nolabel="1" colspan="2">
51                                 <tree string="Widgets" editable="bottom">
52                                     <field name="sequence"/>
53                                     <field name="widget_id"/>
54                                 </tree>
55                             </field>
56                         </group>
57                         <group colspan="2" col="2">
58                             <separator string="Portal Menu" colspan="2"/>
59                             <field name="override_menu"/>
60                             <field name="parent_menu_id"
61                                 context="{'ir.ui.menu.full_list': True}"/>
62                             <label colspan="1"/>
63                             <button name="do_create_menu" type="object"
64                                 string="Create Parent Menu"/>
65                             <field name="home_action_id"/>
66                         </group>
67                     </page>
68                 </page>
69             </field>
70         </record>
71
72         <record model="ir.ui.view" id="product.product_kanban_view">
73             <field name="name">Product Kanban</field>
74             <field name="model">product.product</field>
75             <field name="type">kanban</field>
76             <field name="arch" type="xml">
77                 <kanban>
78                     <field name="color"/>
79                     <field name="type"/>
80                     <field name="product_image"/>
81                     <field name="list_price"/>
82                     <templates>
83                         <t t-name="kanban-box">
84                             <div class="oe_product_vignette">
85                                 <div class="oe_product_img">
86                                 <a type="edit"><img t-att-src="kanban_image('product.product', 'product_image', record.id.value)" class="oe_product_photo"/></a>
87                                 </div>
88                                 <div class="oe_product_desc">
89                                     <h4><a type="edit"><field name="name"></field></a></h4>
90                                     <ul>
91                                         <li t-if="record.type.raw_value != 'service'">Stock on hand: <field name="qty_available"/> <field name="uom_id"/></li>
92                                         <li t-if="record.type.raw_value != 'service'">Stock available: <field name="virtual_available"/> <field name="uom_id"/></li>
93                                         <li>Price: <field name="lst_price"></field></li>
94                                     </ul>
95                                 </div>
96                             </div>
97                             <script>
98                                 $('.oe_product_photo').load(function() { if($(this).width() > $(this).height()) { $(this).addClass('oe_product_photo_wide') } });
99                             </script>
100                             <div></div>
101                         </t>
102                     </templates>
103                 </kanban>
104             </field>
105         </record>
106
107         <record id="action_contact_us" model="ir.actions.act_window">
108             <field name="name">Contact Us</field>
109             <field name="res_model">res.company</field>
110             <field name="type">ir.actions.act_window</field>
111             <field name="view_type">form</field>
112             <field name="view_mode">form,tree</field>
113             <field name="domain">[]</field>
114             <field name="view_id" ref="base.view_company_form" />
115         </record>
116
117     </data>
118 </openerp>