94f9db13530b06b1737dbde41b24effd3c994186
[odoo/odoo.git] / addons / product / pricelist_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5         <menuitem id="base.menu_sale_config_sales" name="Sales"
6             parent="base.menu_base_config" sequence="0"/>
7         <menuitem id="menu_product_pricelist_main" name="Pricelists" 
8             parent="base.menu_base_config" groups="product.group_sale_pricelist" sequence="70"/>
9
10         <record id="product_pricelist_version_form_view" model="ir.ui.view">
11             <field name="name">product.pricelist.version.form</field>
12             <field name="model">product.pricelist.version</field>
13             <field name="arch" type="xml">
14                 <form string="Pricelist Version">
15                     <group>
16                         <group>
17                             <field name="name"/>
18                             <field name="pricelist_id"/>
19                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
20                         </group>
21                         <group>
22                             <field name="date_start"/>
23                             <field name="date_end"/>
24                             <field name="active"/>
25                         </group>
26                     </group>
27                     <notebook>
28                     <page string="Item List">
29                         <field name="items_id"/>
30                     </page>
31                     </notebook>
32                 </form>
33             </field>
34         </record>
35         <record id="product_pricelist_version_tree_view" model="ir.ui.view">
36             <field name="name">product.pricelist.version.tree</field>
37             <field name="model">product.pricelist.version</field>
38             <field name="arch" type="xml">
39                 <tree string="Pricelist Version">
40                     <field name="name"/>
41                     <field name="pricelist_id"/>
42                     <field name="date_start"/>
43                     <field name="date_end"/>
44                 </tree>
45             </field>
46         </record>
47
48         <record id="product_pricelist_action" model="ir.actions.act_window">
49             <field name="name">Pricelist Versions</field>
50             <field name="type">ir.actions.act_window</field>
51             <field name="res_model">product.pricelist.version</field>
52             <field name="view_type">form</field>
53             <field name="view_id" ref="product_pricelist_version_tree_view"/>
54             <field name="help" type="html">
55               <p class="oe_view_nocontent_create">
56                 Click to add a pricelist version.
57               </p><p>
58                 There can be more than one version of a pricelist, each of
59                 these must be valid during a certain period of time. Some
60                 examples of versions: Main Prices, 2010, 2011, Summer Sales,
61                 etc.
62               </p>
63             </field>
64         </record>
65         <menuitem
66             action="product_pricelist_action" id="menu_product_pricelist_action"
67             parent="product.menu_product_pricelist_main" sequence="2"/>
68
69         <record id="product_pricelist_item_tree_view" model="ir.ui.view">
70             <field name="name">product.pricelist.item.tree</field>
71             <field name="model">product.pricelist.item</field>
72             <field name="arch" type="xml">
73                 <tree string="Products Listprices Items">
74                     <field name="sequence"/>
75                     <field colspan="4" name="name"/>
76                     <field name="product_id"/>
77                     <field name="product_tmpl_id"/>
78                     <field name="categ_id"/>
79                     <field name="min_quantity"/>
80                     <field name="base"/>
81                 </tree>
82             </field>
83         </record>
84
85         <record id="product_pricelist_item_form_view" model="ir.ui.view">
86             <field name="name">product.pricelist.item.form</field>
87             <field name="model">product.pricelist.item</field>
88             <field name="arch" type="xml">
89                 <form string="Products Listprices Items">
90                     <label for="name" class="oe_edit_only"/>
91                     <h1><field colspan="4" name="name"/></h1>
92
93                     <group col="4">
94                         <field name="product_id" on_change="product_id_change(product_id)"/>
95                         <field name="product_tmpl_id"/>
96                         <field name="categ_id"/>
97                         <field name="company_id" groups="base.group_multi_company" widget="selection"/>
98                         <field name="min_quantity"/>
99                         <field name="sequence"/>
100                     </group>
101                     <group col="4" string="Price Computation">
102                         <field name="base"/>
103                         <field name="base_pricelist_id" attrs="{'invisible':[('base', '!=', -1)],'required': [('base','=', -1)], 'readonly': [('base','!=', -1)]}"/>
104                     </group>
105                     <group col="6" colspan="5">
106                         <label string="New Price ="/>
107                         <label string="Base Price"/>
108                         <label string="* ( 1 + "/>
109                         <field name="price_discount" nolabel="1"/>
110                         <label string=" ) + "/>
111                         <field name="price_surcharge" nolabel="1"/>
112                         <newline/>
113                         <field name="price_round" string="Rounding Method"/>
114                         <field name="price_min_margin" string="Min. Margin"/>
115                         <field name="price_max_margin" string="Max. Margin"/>
116                     </group>
117
118                 </form>
119             </field>
120         </record>
121
122         <record model="ir.ui.view" id="product_pricelist_view_search">
123             <field name="name">product.pricelist.search</field>
124             <field name="model">product.pricelist</field>
125             <field name="arch" type="xml">
126                 <search string="Products Price Search">
127                     <field name="name" string="Products Price"/>
128                     <field name="type"/>
129                     <field name="active" />
130                     <field name="currency_id" groups="base.group_multi_currency"/>
131                 </search>
132             </field>
133         </record>
134
135
136         <record id="product_pricelist_view_tree" model="ir.ui.view">
137             <field name="name">product.pricelist.tree</field>
138             <field name="model">product.pricelist</field>
139             <field name="arch" type="xml">
140                 <tree string="Products Price List">
141                     <field name="name"/>
142                     <field name="type"/>
143                     <field name="currency_id" groups="base.group_multi_currency"/>
144                     <field name="active" />
145                 </tree>
146             </field>
147         </record>
148         <record id="product_pricelist_view" model="ir.ui.view">
149             <field name="name">product.pricelist.form</field>
150             <field name="model">product.pricelist</field>
151             <field name="arch" type="xml">
152                 <form string="Products Price List">
153                     <label for="name" class="oe_edit_only"/>
154                     <h1>
155                         <field name="name"/>
156                     </h1>
157                     <group col="4">
158                         <field name="active"/>
159                         <field name="type"/>
160                         <field name="currency_id" groups="base.group_multi_currency"/>
161                         <field name="company_id" groups="base.group_multi_company" widget="selection"/>
162                     </group>
163                     <field name="version_id" context="{'type':type}">
164                         <form string="Pricelist Version">
165                             <group col="4">
166                                 <field name="name"/>
167                                 <field name="active"/>
168                                 <field name="date_start"/>
169                                 <field name="date_end"/>
170                             </group>
171                             <field name="items_id" context="{'type':type}"/>
172                         </form>
173                         <tree string="Pricelist Version">
174                             <field name="name"/>
175                             <field name="active"/>
176                             <field name="date_start"/>
177                             <field name="date_end"/>
178                         </tree>
179                     </field>
180                 </form>
181             </field>
182         </record>
183         <record id="product_pricelist_action2" model="ir.actions.act_window">
184             <field name="name">Pricelists</field>
185             <field name="type">ir.actions.act_window</field>
186             <field name="res_model">product.pricelist</field>
187             <field name="view_type">form</field>
188             <field name="view_mode">tree,form</field>
189             <field name="search_view_id" ref="product_pricelist_view_search" />
190             <field name="context">{"default_type":"sale", "search_default_type":"sale"}</field>
191             <field name="help" type="html">
192               <p class="oe_view_nocontent_create">
193                 Click to create a pricelist.
194               </p><p>
195                 A price list contains rules to be evaluated in order to compute
196                 the sales price of the products.
197               </p><p>
198                 Price lists may have several versions (2010, 2011, Promotion of
199                 February 2010, etc.) and each version may have several rules.
200                 (e.g. the customer price of a product category will be based on
201                 the supplier price multiplied by 1.80).
202               </p>
203             </field>
204         </record>
205         <record id="product_pricelist_action_for_purchase" model="ir.actions.act_window">
206             <field name="name">Pricelists</field>
207             <field name="type">ir.actions.act_window</field>
208             <field name="res_model">product.pricelist</field>
209             <field name="view_type">form</field>
210             <field name="view_mode">tree,form</field>
211             <field name="search_view_id" ref="product_pricelist_view_search" />
212             <field name="context">{"default_type":"purchase", "search_default_type":"purchase"}</field>
213             <field name="help" type="html">
214               <p class="oe_view_nocontent_create">
215                 Click to create a pricelist.
216               </p><p>
217                 A price list contains rules to be evaluated in order to compute
218                 the purchase price. The default price list has only one rule; use
219                 the cost price defined on the product form, so that you do not have to
220                 worry about supplier pricelists if you have very simple needs.
221               </p><p>
222                 But you can also import complex price lists form your supplier
223                 that may depends on the quantities ordered or the current
224                 promotions.
225               </p>
226             </field>
227         </record>
228         <menuitem
229             action="product_pricelist_action2" id="menu_product_pricelist_action2"
230             parent="product.menu_product_pricelist_main" sequence="1" groups="product.group_sale_pricelist"/>
231
232         <record id="product_price_type_view" model="ir.ui.view">
233             <field name="name">product.price.type.form</field>
234             <field name="model">product.price.type</field>
235             <field name="arch" type="xml">
236                 <form string="Products Price Type">
237                     <group col="4">
238                         <field name="name"/>
239                         <field name="active"/>
240                         <field name="field"/>
241                         <field name="currency_id" groups="base.group_multi_currency"/>
242                     </group>
243                 </form>
244             </field>
245         </record>
246
247         <record id="product_price_type_action" model="ir.actions.act_window">
248             <field name="name">Price Types</field>
249             <field name="type">ir.actions.act_window</field>
250             <field name="res_model">product.price.type</field>
251             <field name="view_type">form</field>
252             <field name="view_mode">tree,form</field>
253         </record>
254
255         <menuitem
256             action="product_price_type_action" id="menu_product_price_type"
257             parent="product.menu_product_pricelist_main" sequence="4" groups="base.group_no_one"/>
258
259     </data>
260 </openerp>