[ADD] purchase: web_icon for purchases application
[odoo/odoo.git] / addons / purchase / purchase_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4        <menuitem icon="terp-purchase" id="base.menu_purchase_root" name="Purchases" sequence="3"
5            groups="group_purchase_manager,group_purchase_user"
6            web_icon="images/purchases.png"
7            web_icon_hover="images/purchases-hover.png"/>
8        <menuitem id="menu_procurement_management" name="Purchase Management"
9             parent="base.menu_purchase_root" sequence="1" />
10
11         <!--supplier addresses action-->
12         <record id="action_supplier_address_form" model="ir.actions.act_window">
13             <field name="name">Addresses</field>
14             <field name="type">ir.actions.act_window</field>
15             <field name="res_model">res.partner.address</field>
16             <field name="view_type">form</field>
17             <field name="context">{"search_default_supplier":1}</field>
18             <field name="search_view_id" ref="base.view_res_partner_address_filter"/>
19             <field name="help">Access your supplier records and maintain your relationship with them. You can track all your interactions with them through the history tab: emails, orders, meeting, etc.</field>
20         </record>
21         <record id="action_supplier_address_form_view1" model="ir.actions.act_window.view">
22             <field eval="10" name="sequence"/>
23             <field name="view_mode">tree</field>
24             <field name="view_id" ref="base.view_partner_address_tree"/>
25             <field name="act_window_id" ref="action_supplier_address_form"/>
26         </record>
27         <record id="action_supplier_address_form_view2" model="ir.actions.act_window.view">
28             <field eval="20" name="sequence"/>
29             <field name="view_mode">form</field>
30             <field name="view_id" ref="base.view_partner_address_form1"/>
31             <field name="act_window_id" ref="action_supplier_address_form"/>
32         </record>
33
34      <!--supplier menu-->
35       <menuitem id="base.menu_procurement_management_supplier" name="Address Book"
36             parent="base.menu_purchase_root" sequence="3"/>
37       <menuitem id="base.menu_procurement_management_supplier_name" name="Suppliers"
38             parent="base.menu_procurement_management_supplier"
39             action="base.action_partner_supplier_form" sequence="1"/>
40
41           <!--Inventory control-->
42       <menuitem id="menu_procurement_management_inventory" name="Receive Products"
43             parent="base.menu_purchase_root" sequence="4"/>
44       <menuitem action="stock.action_picking_tree4" id="menu_action_picking_tree4" parent="menu_procurement_management_inventory"
45             name="Incoming Shipments" sequence="9"
46             groups="base.group_extended"/>
47       <menuitem action="stock.action_reception_picking_move" id="menu_action_picking_tree_in_move"
48             parent="menu_procurement_management_inventory" sequence="11"/>
49
50      <!--Invoice control-->
51      <menuitem id="menu_procurement_management_invoice" name="Invoice Control"
52           parent="base.menu_purchase_root" sequence="6"/>
53
54     <record id="action_invoice_pending" model="ir.actions.act_window">
55         <field name="res_model">account.invoice</field>
56         <field name="view_type">form</field>
57         <field name="view_mode">tree,form,calendar,graph</field>
58         <field eval="False" name="view_id"/>
59         <field name="domain">[('type','=','in_invoice')]</field>
60         <field name="context">{'type':'in_invoice', 'journal_type': 'purchase', 'search_default_draft': 1}</field>
61         <field name="search_view_id" ref="account.view_account_invoice_filter"/>
62             <field name="help">Use this menu to control the invoices to be received by your supplier. OpenERP pre-generates draft of invoices based on your purchase orders or your receptions. Once you receive a supplier invoice, you can control it according to the draft of invoice and validate it.</field>
63     </record>
64
65      <menuitem name="Supplier Invoices to Receive"
66           id="menu_procurement_management_pending_invoice"
67           action="action_invoice_pending"
68           parent="menu_procurement_management_invoice"
69           sequence="13"/>
70
71       <!--product menu-->
72       <menuitem id="menu_procurement_management_product" name="Products"
73           parent="base.menu_purchase_root" sequence="8"/>
74       <menuitem name="Products" id="menu_procurement_partner_contact_form" action="product.product_normal_action_puchased"
75           parent="menu_procurement_management_product"/>
76
77        <record model="ir.ui.view" id="purchase_order_calendar">
78             <field name="name">purchase.order.calendar</field>
79             <field name="model">purchase.order</field>
80             <field name="type">calendar</field>
81             <field name="priority" eval="2"/>
82             <field name="arch" type="xml">
83                 <calendar string="Calendar View" date_start="minimum_planned_date" color="partner_id">
84                     <field name="name"/>
85                     <field name="amount_total"/>
86                     <field name="partner_id"/>
87                 </calendar>
88             </field>
89         </record>
90         <record model="ir.ui.view" id="view_purchase_order_graph">
91             <field name="name">purchase.order.graph</field>
92             <field name="model">purchase.order</field>
93             <field name="type">graph</field>
94             <field name="arch" type="xml">
95                 <graph string="Purchase Order" type="bar">
96                     <field name="partner_id"/>
97                     <field name="amount_total" operator="+"/>
98                 </graph>
99             </field>
100         </record>
101
102         <record id="purchase_order_form" model="ir.ui.view">
103             <field name="name">purchase.order.form</field>
104             <field name="model">purchase.order</field>
105             <field name="type">form</field>
106             <field name="arch" type="xml">
107                 <form string="Purchase Order">
108                     <group col="6" colspan="4">
109                         <field name="name"/>
110                         <field name="date_order"/>
111                         <field name="invoiced"/>
112                         <newline/>
113                         <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection"/>
114                         <field name="partner_ref"/>
115                         <field name="shipped"/>
116                         <field name="company_id" groups="base.group_multi_company" widget="selection"/>
117                     </group>
118                     <notebook colspan="4">
119                         <page string="Purchase Order">
120                             <field name="partner_id" on_change="onchange_partner_id(partner_id)" domain="[('supplier','=',True)]" context="{'search_default_supplier':1}" />
121                             <field name="partner_address_id"/>
122                             <field domain="[('type','=','purchase')]" name="pricelist_id" groups="base.group_extended"/>
123                             <field name="origin" groups="base.group_extended"/>
124                             <newline/>
125                             <field colspan="4" name="order_line" nolabel="1" mode="tree,form">
126                                 <tree string="Purchase Order Lines">
127                                     <field name="date_planned"/>
128                                     <field name="name"/>
129                                     <field name="product_qty"/>
130                                     <field name="product_uom"/>
131                                     <field name="price_unit"/>
132                                     <field name="price_subtotal"/>
133                                 </tree>
134                                 <!-- default form view -->
135                             </field>
136                             <group col="7" colspan="4">
137                                 <field name="amount_untaxed" sum="Untaxed amount"/>
138                                 <field name="amount_tax"/>
139                                 <field name="amount_total" sum="Total amount"/>
140                                 <button name="button_dummy" states="draft" string="Compute" type="object" icon="gtk-execute"/>
141                             </group>
142                             <group col="11" colspan="4">
143                                 <field name="state" readonly="1"/>
144                                 <button name="purchase_cancel" states="draft,confirmed,wait_auth" string="Cancel" icon="gtk-cancel"/>
145                                 <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="gtk-convert"/>
146                                 <button name="action_cancel" states="approved,except_picking,except_invoice" string="Cancel Purchase Order" type="object" icon="gtk-cancel"/>
147                                 <button name="picking_ok" states="except_picking" string="Manually Corrected" icon="gtk-convert"/>
148                                 <button name="invoice_ok" states="except_invoice" string="Manually Corrected" icon="gtk-convert"/>
149                                 <button name="purchase_confirm" states="draft" string="Convert to Purchase Order" icon="gtk-go-forward"/>
150                                 <button name="purchase_appbuyer" states="wait_auth" string="Approve Purchase" icon="gtk-ok"/>
151                                 <button name="purchase_approve" states="confirmed" string="Approved by Supplier" icon="gtk-go-forward"/>
152                                 <button name="%(report_purchase_order)d" string="Print" states="approved" type="action" icon="gtk-print"/>
153                             </group>
154                         </page>
155                         <page string="Delivery &amp; Invoicing" groups="base.group_extended">
156                             <group colspan="2" col="2">
157                                 <separator string="Delivery" colspan="2"/>
158                                 <field name="dest_address_id" on_change="onchange_dest_address_id(dest_address_id)"/>
159                                 <field name="minimum_planned_date"/>
160                                 <field name="location_id"/>
161                             </group>
162                             <group colspan="2" col="2">
163                                 <separator string="Invoice Control" colspan="2"/>
164                                 <field name="invoice_method"/>
165                                 <field name="invoice_id" readonly="1" groups="base.group_extended"/>
166                                 <field name="fiscal_position" widget="selection"/>
167                             </group>
168                             <newline/>
169                             <separator string="Purchase Control" colspan="4"/>
170                             <field name="validator"/>
171                             <field name="date_approve"/>
172                         </page>
173                         <page string="Notes">
174                             <field colspan="4" name="notes" nolabel="1"/>
175                         </page>
176                     </notebook>
177                 </form>
178             </field>
179         </record>
180
181        <record id="view_purchase_order_filter" model="ir.ui.view">
182             <field name="name">purchase.order.list.select</field>
183             <field name="model">purchase.order</field>
184             <field name="type">search</field>
185             <field name="arch" type="xml">
186                 <search string="Search Purchase Order">
187                  <group col='10' colspan='4'>
188                     <filter icon="terp-document-new" name="draft" string="Quotations" domain="[('state','=','draft')]" separator="1" help="Purchase order which are in draft state"/>
189                     <filter icon="terp-camera_test" name="confirmed" string="To Approve" domain="[('state','in',('wait','confirmed'))]" separator="1" help="Purchase order to be approved"/>
190                     <filter icon="terp-check" name="approved" string="Approved" domain="[('state','in',('approved','done'))]" separator="1" help="Approved purchase order"/>
191                     <separator orientation="vertical"/>
192                     <filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" separator="1" help="Purchase order which are in the exception state"/>
193                     <separator orientation="vertical"/>
194                     <filter icon="terp-gtk-go-back-rtl" string="To be Invoiced" domain="[('invoiced','=',1)]" separator="1" help="Purchase order to be invoiced"/>
195                     <separator orientation="vertical"/>
196                     <field name="name" select="1" string="Reference"/>
197                     <field name="partner_id" select="1"/>
198                     <field name="product_id" select="1"/>
199                     <field name="create_uid" select="1"/>
200                 </group>
201                 <newline/>
202                   <group expand="0" string="Group By..." colspan="4" col="10" groups="base.group_extended">
203                     <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
204                      <separator orientation="vertical"/>
205                     <filter string="Origin" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
206                     <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
207                      <separator orientation="vertical"/>
208                     <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
209                     <filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'minimum_planned_date'}"/>
210
211                 </group>
212               </search>
213             </field>
214         </record>
215         <record id="purchase_order_tree" model="ir.ui.view">
216             <field name="name">purchase.order.tree</field>
217             <field name="model">purchase.order</field>
218             <field name="type">tree</field>
219             <field name="arch" type="xml">
220                 <tree colors="grey:state=='cancel';blue:state in ('wait','confirmed');red:state in ('except_invoice','except_picking')" string="Purchase Order">
221                     <field name="name" string="Reference"/>
222                     <field name="date_order" string="Order Date"/>
223                     <field name="partner_id"/>
224                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
225                     <field name="location_id"/>
226                     <field name="minimum_planned_date"/>
227                     <field name="origin"/>
228                     <field name="invoiced_rate" widget="progressbar"/>
229                     <field name="shipped_rate" widget="progressbar"/>
230                     <field name="amount_untaxed" sum="Total Untaxed amount"/>
231                     <field name="amount_total" sum="Total amount"/>
232                     <field name="state"/>
233                 </tree>
234             </field>
235         </record>
236
237         <record id="purchase_rfq" model="ir.actions.act_window">
238             <field name="name">Requests for Quotation</field>
239             <field name="type">ir.actions.act_window</field>
240             <field name="res_model">purchase.order</field>
241             <field name="view_type">form</field>
242             <field name="context">{'search_default_draft': 1}</field>
243             <field name="view_mode">tree,form,graph,calendar</field>
244             <field name="search_view_id" ref="view_purchase_order_filter"/>
245             <field name="help">With the Requests for quotation menu you can create new request for quotations, review existing one and confirm them to order once the supplier offer is approved. When you confirm a RfQ, OpenERP will convert it to a Purchase Order and generate the next steps: draft reception of the products, invoice to control.</field>
246         </record>
247         <menuitem action="purchase_rfq" id="menu_purchase_rfq" parent="menu_procurement_management"
248                 sequence="6" groups="group_purchase_manager,group_purchase_user"/>
249
250         <record id="purchase_form_action" model="ir.actions.act_window">
251             <field name="name">Purchase Orders</field>
252             <field name="type">ir.actions.act_window</field>
253             <field name="res_model">purchase.order</field>
254             <field name="view_mode">tree,form,graph,calendar</field>
255             <field name="context">{'search_default_approved': 1,'search_default_create_uid':uid}</field>
256             <field name="search_view_id" ref="view_purchase_order_filter"/>
257             <field name="help">From the Purchase Orders menu, you can track the status of your orders: products received, invoice received and controlled.
258 </field>
259         </record>
260         <menuitem action="purchase_form_action" id="menu_purchase_form_action" parent="menu_procurement_management" />
261
262
263         <record id="purchase_order_line_form" model="ir.ui.view">
264             <field name="name">purchase.order.line.form</field>
265             <field name="model">purchase.order.line</field>
266             <field name="type">form</field>
267             <field name="arch" type="xml">
268                 <form string="Purchase Order Line">
269                     <notebook colspan="4">
270                         <page string="Order Line">
271                             <field colspan="4" context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,notes)"/>
272                             <field context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" name="product_qty" on_change="product_id_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id,parent.date_order,parent.fiscal_position,date_planned,name,price_unit,notes)"/>
273                             <field name="product_uom" on_change="product_uom_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position)"/>
274                             <field colspan="4" name="name"/>
275                             <field name="date_planned" widget="date"/>
276                             <field name="price_unit"/>
277                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
278                             <field name="account_analytic_id" colspan="4" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]" />
279                             <group colspan="4" col="4" groups="base.group_extended">
280                                 <separator colspan="4" string="Taxes"/>
281                                 <field colspan="4" nolabel="1" name="taxes_id"
282                                     domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
283                             </group>
284                         </page>
285                         <page string="Invoicing" groups="base.group_extended">
286                             <separator colspan="4" string="Manual Invoices"/>
287                             <field name="invoiced"/>
288                             <newline/>
289                             <field colspan="4" name="invoice_lines" nolabel="1" widget="many2many"/>
290                         </page>
291                            <page string="Notes">
292                             <field colspan="4" name="notes" nolabel="1"/>
293                         </page>
294                         <page string="History" groups="base.group_extended">
295                                <separator colspan="4" string="Stock Moves"/>
296                                <field colspan="4" name="move_ids" nolabel="1" widget="many2many"/>
297                         </page>
298                     </notebook>
299                 </form>
300             </field>
301         </record>
302
303         <record id="purchase_order_line_tree" model="ir.ui.view">
304             <field name="name">purchase.order.line.tree</field>
305             <field name="model">purchase.order.line</field>
306             <field name="type">tree</field>
307             <field name="arch" type="xml">
308                 <tree string="Purchase Order Lines">
309                     <field name="order_id"/>
310                     <field name="name"/>
311                     <field name="partner_id" string="Supplier" />
312                     <field name="product_id"/>
313                     <field name="price_unit"/>
314                     <field name="product_qty"/>
315                     <field name="product_uom"/>                    
316                     <field name="price_subtotal"/>
317                     <field name="date_planned"  widget="date" width="135"/>
318                     
319                    
320                     
321                     <field name="state" invisible="1"/>
322                     <field name="invoiced" invisible="1"/>
323                 </tree>
324             </field>
325         </record>
326         <record id="purchase_order_line_form2" model="ir.ui.view">
327             <field name="name">purchase.order.line.form2</field>
328             <field name="model">purchase.order.line</field>
329             <field name="type">form</field>
330             <field name="priority" eval="20"/>
331             <field name="arch" type="xml">
332                 <form string="Purchase Order Line">
333                     <notebook colspan="4">
334                         <page string="Order Line">
335                                <separator colspan="4" string="General Information"/>
336                              <field name="order_id"/>
337                             <field name="product_id" readonly="1" />
338                             <field name="product_qty" readonly="1" />
339                             <field name="product_uom" readonly="1"/>
340                             <field colspan="4" name="name"/>
341                             <field name="date_planned" widget="date"  readonly="1"/>
342                             <field name="price_unit"/>
343                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
344                             <field name="account_analytic_id" colspan="4" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
345                             <group colspan="4" col="4" groups="base.group_extended">
346                                 <separator colspan="4" string="Taxes"/>
347                                 <field colspan="4" nolabel="1" name="taxes_id"
348                                     domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
349                             </group>
350                         </page>
351                         <page string="Invoicing" groups="base.group_extended">
352                             <separator colspan="4" string="Manual Invoices"/>
353                             <field name="invoiced"/>
354                             <newline/>
355                             <field colspan="4" name="invoice_lines" nolabel="1" widget="many2many"/>
356                         </page>
357                          <page string="Notes">
358                             <field colspan="4" name="notes" nolabel="1"/>
359                         </page>
360                         <page string="History" groups="base.group_extended">
361                                <separator colspan="4" string="Stock Moves"/>
362                                <field colspan="4" name="move_ids" nolabel="1" widget="many2many"/>
363                         </page>
364                     </notebook>
365                 </form>
366             </field>
367         </record>
368           <record id="purchase_order_line_search" model="ir.ui.view">
369             <field name="name">purchase.order.line.search</field>
370             <field name="model">purchase.order.line</field>
371             <field name="type">search</field>
372             <field name="arch" type="xml">
373                 <search string="Search Purchase Order">
374                         <group>
375                         <field name="order_id"/>
376                         <field name="product_id"/>
377                         <field name="partner_id"  string="Supplier"/>
378                         </group> 
379                         <newline/>
380                         <group expand="0" string="Group By...">
381                         <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by' : 'partner_id'}" />
382                         <separator orientation="vertical"/>
383                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by' : 'product_id'}" />
384                         <filter icon="terp-gtk-jump-to-rtl" string="Order Reference" domain="[]" context="{'group_by' :'order_id'}"/>
385                         <separator orientation="vertical"/>
386                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by' : 'state'}" />
387                         </group>
388                </search>
389             </field>
390         </record>
391
392         <act_window
393             context="{'search_default_partner_id': [active_id]}"
394             id="act_res_partner_2_purchase_order"
395             name="Purchase Orders"
396             res_model="purchase.order"
397             src_model="res.partner"/>
398
399         <act_window
400             context="{'search_default_product_id': [active_id]}"
401             id="action_purchase_line_product_tree"
402             name="Purchases"
403             res_model="purchase.order.line"
404             src_model="product.product"
405             groups="base.group_extended"/>
406
407
408         <record id="purchase_line_form_action2" model="ir.actions.act_window">
409             <field name="name">Purchase Lines Not Invoiced</field>
410             <field name="type">ir.actions.act_window</field>
411             <field name="res_model">purchase.order.line</field>
412             <field name="domain">[('state','in',('confirmed','done')), ('invoiced', '=', False)]</field>
413             <field name="view_type">form</field>
414             <field name="view_mode">tree,form</field>
415             <field name="search_view_id" ref="purchase_order_line_search"/>
416             <field name="help">If you set the invoicing control on a purchase order as "Manual", you can track here all the purchase order lines for which you did not received the supplier invoice yet. Once you are ready to receive a supplier invoice, you can generate a draft supplier invoice based on the lines from this menu.</field>
417         </record>
418         <record id="purchase_line_form_action_tree2" model="ir.actions.act_window.view">
419             <field eval="1" name="sequence"/>
420             <field name="view_mode">tree</field>
421             <field name="view_id" ref="purchase_order_line_tree"/>
422             <field name="act_window_id" ref="purchase_line_form_action2"/>
423         </record>
424         <record id="purchase_line_form_action_form2" model="ir.actions.act_window.view">
425             <field eval="2" name="sequence"/>
426             <field name="view_mode">form</field>
427             <field name="view_id" ref="purchase_order_line_form2"/>
428             <field name="act_window_id" ref="purchase_line_form_action2"/>
429         </record>
430         <menuitem
431             action="purchase_line_form_action2"
432             id="menu_purchase_line_order_draft"
433             groups="base.group_extended"
434             parent="menu_procurement_management_invoice"
435             sequence="72"/>
436
437         <!--
438             Procurements
439         -->
440
441         <record id="view_procurement_form_inherit" model="ir.ui.view">
442             <field name="name">procurement.order.form.inherit</field>
443             <field name="model">procurement.order</field>
444             <field name="inherit_id" ref="procurement.procurement_form_view"/>
445             <field name="type">form</field>
446             <field name="arch" type="xml">
447                 <xpath expr="/form/notebook/page/field[@name='close_move']" position="before">
448                     <field name="purchase_id"/>
449                 </xpath>
450             </field>
451         </record>
452
453     </data>
454 </openerp>