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