Merge with addons-trunk revno 7150
[odoo/odoo.git] / addons / purchase / purchase_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4
5         <!-- Top menu item -->
6         <menuitem name="Purchases"
7             id="base.menu_purchase_root"
8             groups="group_purchase_manager,group_purchase_user"
9             sequence="40"/>
10
11         <menuitem id="menu_procurement_management" name="Purchase"
12             parent="base.menu_purchase_root" sequence="1" />
13
14         <menuitem id="menu_purchase_config_purchase" name="Configuration"
15             groups="group_purchase_manager"
16             parent="base.menu_purchase_root" sequence="100"/>
17
18         <menuitem
19             id="menu_purchase_config_pricelist" name="Pricelists"
20             parent="menu_purchase_config_purchase" sequence="50" groups="product.group_purchase_pricelist"/>
21
22         <menuitem
23             action="product.product_pricelist_action" id="menu_product_pricelist_action_purhase"
24             parent="menu_purchase_config_pricelist" sequence="20" groups="base.group_no_one"/>
25
26         <menuitem
27             action="product.product_pricelist_action_for_purchase" id="menu_product_pricelist_action2_purchase"
28             parent="menu_purchase_config_pricelist" sequence="10" />
29
30         <menuitem
31             id="menu_product_in_config_purchase" name="Products"
32             parent="menu_purchase_config_purchase" sequence="30" groups="base.group_no_one"/>
33
34         <menuitem
35             action="product.product_category_action_form" id="menu_product_category_config_purchase"
36             parent="purchase.menu_product_in_config_purchase" sequence="1" />
37
38         <menuitem
39             id="menu_purchase_unit_measure_purchase" name="Units of Measure"
40             parent="purchase.menu_product_in_config_purchase"  sequence="20" groups="product.group_uom"/>
41
42         <menuitem
43              action="product.product_uom_categ_form_action" id="menu_purchase_uom_categ_form_action"
44              parent="purchase.menu_product_in_config_purchase" sequence="5" />
45
46         <menuitem
47               action="product.product_uom_form_action" id="menu_purchase_uom_form_action"
48               parent="purchase.menu_product_in_config_purchase" sequence="10"/>
49
50         <menuitem
51             id="menu_purchase_partner_cat" name="Address Book"
52             parent="menu_purchase_config_purchase"/>
53
54         <menuitem
55             action="base.action_partner_category_form" id="menu_partner_categories_in_form" name="Partner Categories"
56             parent="purchase.menu_purchase_partner_cat" groups="base.group_no_one"/>
57
58     <!--Supplier menu-->
59     <menuitem id="base.menu_procurement_management_supplier_name" name="Suppliers"
60         parent="menu_procurement_management"
61         action="base.action_partner_supplier_form" sequence="15"/>
62
63       <!--Inventory control-->
64       <menuitem id="menu_procurement_management_inventory" name="Receive Products"
65             parent="base.menu_purchase_root" sequence="4"/>
66       <menuitem action="stock.action_picking_tree4" id="menu_action_picking_tree4" parent="menu_procurement_management_inventory"
67             name="Incoming Shipments" sequence="9"/>
68       <menuitem action="stock.action_reception_picking_move" id="menu_action_picking_tree_in_move"
69             parent="menu_procurement_management_inventory" sequence="11"/>
70
71     <!--Invoice control-->
72     <menuitem id="menu_procurement_management_invoice" name="Invoice Control"
73         parent="base.menu_purchase_root" sequence="6"/>
74
75     <record id="action_invoice_pending" model="ir.actions.act_window">
76         <field name="name">Based on Draft Invoices</field>
77         <field name="res_model">account.invoice</field>
78         <field name="view_type">form</field>
79         <field name="view_mode">tree,form,calendar,graph</field>
80         <field eval="False" name="view_id"/>
81         <field name="domain">[('type','=','in_invoice')]</field>
82         <field name="context">{'default_type':'in_invoice', 'type':'in_invoice', 'journal_type': 'purchase', 'search_default_draft': 1}</field>
83         <field name="search_view_id" ref="account.view_account_invoice_filter"/>
84         <field name="help">
85             Use this menu to control the invoices to be received from your supplier.
86             OpenERP generates draft invoices from your purchase orders or receptions, according to your settings.
87             Once you receive a supplier invoice, you can match it with the draft invoice and validate it.
88         </field>
89     </record>
90
91      <menuitem name="Based on Draft Invoices"
92           id="menu_procurement_management_pending_invoice"
93           action="action_invoice_pending"
94           parent="menu_procurement_management_invoice"
95           sequence="13"/>
96
97       <!-- Product menu-->
98       <menuitem id="menu_procurement_management_product" name="Products"
99           parent="base.menu_purchase_root" sequence="8"/>
100
101       <menuitem name="Products by Category" id="menu_product_by_category_purchase_form" action="product.product_category_action"
102            parent="menu_procurement_management_product" sequence="10"/>
103
104       <menuitem name="Products" id="menu_procurement_partner_contact_form" action="product.product_normal_action_puchased"
105           parent="menu_procurement_management_product"/>
106
107         <!-- Purchase order Read/Unread actions -->
108         <record id="actions_server_purchase_order_unread" model="ir.actions.server">
109             <field name="name">Mark unread</field>
110             <field name="condition">True</field>
111             <field name="type">ir.actions.server</field>
112             <field name="model_id" ref="model_purchase_order"/>
113             <field name="state">code</field>
114             <field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
115         </record>
116         <record id="action_purchase_order_unread" model="ir.values">
117             <field name="name">action_purchase_order_unread</field>
118             <field name="action_id" ref="actions_server_purchase_order_unread"/>
119             <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_purchase_order_unread'))" />
120             <field name="key">action</field>
121             <field name="model_id" ref="model_purchase_order" />
122             <field name="model">purchase.order</field>
123             <field name="key2">client_action_multi</field>
124         </record>
125
126         <record id="actions_server_purchase_order_read" model="ir.actions.server">
127             <field name="name">Mark read</field>
128             <field name="condition">True</field>
129             <field name="type">ir.actions.server</field>
130             <field name="model_id" ref="model_purchase_order"/>
131             <field name="state">code</field>
132             <field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
133         </record>
134         <record id="action_purchase_order_read" model="ir.values">
135             <field name="name">action_purchase_order_read</field>
136             <field name="action_id" ref="actions_server_purchase_order_read"/>
137             <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_purchase_order_read'))" />
138             <field name="key">action</field>
139             <field name="model_id" ref="model_purchase_order" />
140             <field name="model">purchase.order</field>
141             <field name="key2">client_action_multi</field>
142         </record>
143
144         <record model="ir.ui.view" id="purchase_order_calendar">
145             <field name="name">purchase.order.calendar</field>
146             <field name="model">purchase.order</field>
147             <field name="type">calendar</field>
148             <field name="priority" eval="2"/>
149             <field name="arch" type="xml">
150                 <calendar string="Calendar View" date_start="minimum_planned_date" color="partner_id">
151                     <field name="name"/>
152                     <field name="amount_total"/>
153                     <field name="partner_id"/>
154                 </calendar>
155             </field>
156         </record>
157         <record model="ir.ui.view" id="purchase_order_graph">
158             <field name="name">purchase.order.graph</field>
159             <field name="model">purchase.order</field>
160             <field name="type">graph</field>
161             <field name="arch" type="xml">
162                 <graph string="Purchase Order" type="bar">
163                     <field name="partner_id"/>
164                     <field name="amount_total" operator="+"/>
165                 </graph>
166             </field>
167         </record>
168
169         <record id="purchase_order_form" model="ir.ui.view">
170             <field name="name">purchase.order.form</field>
171             <field name="model">purchase.order</field>
172             <field name="type">form</field>
173             <field name="arch" type="xml">
174                 <form string="Purchase Order" version="7.0">
175                 <header>
176                     <button name="purchase_confirm" states="draft,sent" string="Confirm Quotation" class="oe_highlight"/>
177                     <button name="wkf_send_rfq" states="draft" string="Send RFQ" type="object" context="{'send_rfq':True}"/>
178                     <button name="wkf_send_rfq" states="confirmed" string="Resend Purchase Order" type="object" class="oe_highlight"/>
179                     <button name="action_cancel" states="except_picking,except_invoice,wait" string="Cancel" type="object" />
180                     <button name="picking_ok" states="except_picking" string="Manually Corrected"/>
181                     <button name="invoice_ok" states="except_invoice" string="Manually Corrected"/>
182                     <button name="purchase_appbuyer" states="wait_auth" string="Approve Purchase" class="oe_highlight"/>
183                     <button name="purchase_approve" states="confirmed" string="Approve Order" class="oe_highlight"/>
184                     <button name="view_invoice" string="Receive Invoice" type="object" attrs="{'invisible': ['|', ('invoice_method','=','picking'), '|', ('state','!=', 'approved'), ('invoiced','=',True) ]}" class="oe_highlight"/>
185                     <button name="view_picking" string="Receive Products" type="object" attrs="{'invisible': ['|', ('shipped','=',True), ('state','!=', 'approved')]}" class="oe_highlight"/>
186                     <button name="action_cancel_draft" states="cancel,sent,confirmed" string="Set to Draft" type="object" />
187                     <button name="purchase_cancel" states="draft,confirmed,wait_auth,sent" string="Cancel"/>
188                     <field name="state" widget="statusbar" statusbar_visible="draft,approved,done" statusbar_colors='{"except_picking":"red","except_invoice":"red","confirmed":"blue","wait":"blue"}' readonly="1"/>
189                 </header>
190                 <sheet>
191                     <div class="oe_title">
192                         <h1>
193                             <label string="Quotation " attrs="{'invisible': [('state','not in',('draft','sent'))]}"/>
194                             <label string="Purchase Order " attrs="{'invisible': [('state','in',('draft','sent'))]}"/>
195                             <field name="name" class="oe_inline" readonly="1"/>
196                         </h1>
197                     </div>
198                     <group>
199                         <group>
200                             <field name="partner_id" on_change="onchange_partner_id(partner_id)" context="{'search_default_supplier':1,'default_supplier':1,'default_customer':0}" domain="[('supplier','=',True)]"/>
201                             <field name="partner_ref"/>
202                             <field domain="[('type','=','purchase')]" name="pricelist_id" groups="product.group_purchase_pricelist"/>
203                         </group>
204                         <group>
205                             <field name="date_order"/>
206                             <field name="origin" attr="{'invisible': [('origin','=',False)]}"/>
207                             <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection" groups="stock.group_locations"/>
208                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
209                         </group>
210                     </group>
211                     <notebook>
212                         <page string="Purchase Order">
213                             <field name="order_line">
214                                 <tree string="Purchase Order Lines">
215                                     <field name="date_planned"/>
216                                     <field name="name"/>
217                                     <field name="product_qty"/>
218                                     <field name="product_uom" groups="product.group_uom"/>
219                                     <field name="price_unit"/>
220                                     <field name="price_subtotal"/>
221                                 </tree>
222                             </field>
223                             <group class="oe_subtotal_footer oe_right">
224                                 <field name="amount_untaxed"/>
225                                 <field name="amount_tax"/>
226                                 <div class="oe_subtotal_footer_separator oe_inline">
227                                     <label for="amount_total"/>
228                                     <button name="button_dummy"
229                                         states="draft" string="(update)" type="object" class="oe_edit_only oe_link"/>
230                                 </div>
231                                 <field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator"/>
232                             </group>
233                             <div class="oe_clear"/>
234                             <label for="notes"/>
235                             <field name="notes"/>
236                         </page>
237                         <page string="Delivery &amp; Invoicing">
238                             <group>
239                                 <group>
240                                     <field name="dest_address_id" string="Customer Address" on_change="onchange_dest_address_id(dest_address_id)"/>
241                                     <field name="minimum_planned_date"/>
242                                     <field name="location_id" groups="stock.group_locations"/>
243                                     <field name="shipped" groups="base.group_no_one"/>
244                                 </group>
245                                 <group>
246                                     <field name="invoice_method"/>
247                                     <field name="invoiced"/>
248                                     <field name="payment_term" widget="selection"/>
249                                     <field name="fiscal_position"/>
250                                     <!-- We do not need these fields anymore, the information is in open chatter -->
251                                     <field name="validator" groups="base.group_no_one"/>
252                                     <field name="date_approve" groups="base.group_no_one"/>
253                                 </group>
254                             </group>
255                             <separator string="Invoices"/>
256                             <field name="invoice_ids" context="{'type':'in_invoice', 'journal_type':'purchase'}"/>
257                         </page>
258                     </notebook>
259                 </sheet>
260                 <div class="oe_chatter">
261                     <field name="message_ids" widget="mail_thread"/>
262                 </div>
263                 </form>
264             </field>
265         </record>
266
267        <record id="view_request_for_quotation_filter" model="ir.ui.view">
268             <field name="name">request.quotation.select</field>
269             <field name="model">purchase.order</field>
270             <field name="type">search</field>
271             <field name="arch" type="xml">
272                 <search string="Search Purchase Order">
273                     <field name="name" string="Reference"/>
274                     <filter icon="terp-document-new" name="draft" string="Quotations" domain="[('state','=','draft')]" help="Purchase order which are in draft state"/>
275                     <filter icon="terp-check" name="approved" string="Approved" domain="[('state','in',('approved','done'))]" help="Approved purchase order"/>
276                     <filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase order which are in the exception state"/>
277                     <separator/>
278                     <filter icon="terp-gtk-go-back-rtl" name="not_invoiced" string="Not Invoiced" domain="[('invoice_ids','=', False)]" help="Purchase orders that include lines not invoiced."/>
279                     <field name="partner_id"/>
280                     <field name="product_id"/>
281                     <field name="create_uid"/>
282                     <group expand="0" string="Group By...">
283                         <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
284                         <filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
285                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
286                         <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
287                         <filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'minimum_planned_date'}"/>
288                     </group>
289                 </search>
290             </field>
291         </record>
292
293         <record id="view_purchase_order_filter" model="ir.ui.view">
294             <field name="name">purchase.order.list.select</field>
295             <field name="model">purchase.order</field>
296             <field name="type">search</field>
297             <field name="arch" type="xml">
298                 <search string="Search Purchase Order">
299                     <field name="name" string="Reference"/>
300                     <filter icon="terp-mail-message-new" string="Inbox" help="Unread messages" name="needaction_pending" domain="[('needaction_pending','=',True)]"/>
301                     <separator/>
302                     <filter icon="terp-document-new" name="draft" string="Quotations" domain="[('state','=','draft')]" help="Purchase orders which are in draft state"/>
303                     <filter icon="terp-check" name="approved" string="Purchase Orders" domain="[('state','not in',('draft','cancel'))]" help="Approved purchase orders"/>
304                     <filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase orders which are in exception state"/>
305                     <separator/>
306                     <filter icon="terp-gtk-go-back-rtl" name="not_invoiced" string="Not Invoiced" domain="[('invoice_ids','=', False)]" help="Purchase orders that include lines not invoiced."/>
307                     <field name="partner_id"/>
308                     <field name="product_id"/>
309                     <field name="create_uid"/>
310                     <group expand="0" string="Group By...">
311                         <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
312                         <filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
313                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
314                         <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
315                         <filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'minimum_planned_date'}"/>
316                     </group>
317                 </search>
318             </field>
319         </record>
320
321         <record id="purchase_order_tree" model="ir.ui.view">
322             <field name="name">purchase.order.tree</field>
323             <field name="model">purchase.order</field>
324             <field name="type">tree</field>
325             <field name="arch" type="xml">
326                 <tree fonts="bold:needaction_pending==True" colors="grey:state=='cancel';blue:state in ('wait','confirmed');red:state in ('except_invoice','except_picking')" string="Purchase Order">
327                     <field name="needaction_pending" invisible="1"/>
328                     <field name="name" string="Reference"/>
329                     <field name="date_order" />
330                     <field name="partner_id"/>
331                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
332                     <field name="minimum_planned_date" invisible="context.get('quotation_only', False)"/>
333                     <field name="origin"/>
334                     <field name="invoiced_rate" widget="progressbar" invisible="context.get('quotation_only', False)"/>
335                     <field name="shipped_rate" widget="progressbar" invisible="context.get('quotation_only', False)"/>
336                     <field name="amount_untaxed" sum="Total Untaxed amount"/>
337                     <field name="amount_total" sum="Total amount"/>
338                     <field name="state"/>
339                 </tree>
340             </field>
341         </record>
342
343         <record id="purchase_rfq" model="ir.actions.act_window">
344             <field name="name">Quotations</field>
345             <field name="type">ir.actions.act_window</field>
346             <field name="res_model">purchase.order</field>
347             <field name="context">{'search_default_draft': 1}</field>
348             <field name="view_mode">tree,form,graph,calendar</field>
349             <field name="search_view_id" ref="view_purchase_order_filter"/>
350             <field name="help">
351                 Create a request for quotation when you want to buy products from a supplier.
352                 You can also use this menu to review requests for quotation created automatically
353                 (based on logistic rules, like minimum stock, MTO, etc.)
354                 &lt;p&gt;
355                 Once confirmed, a request for quotation becomes a purchase order.
356                 In the Purchase Settings, you can select the way to control supplier invoicing:
357                 based on the order, based on receptions, or manual.
358             </field>
359         </record>
360         <menuitem action="purchase_rfq" id="menu_purchase_rfq"
361             parent="menu_procurement_management"
362             sequence="0"/>
363
364         <record id="purchase_form_action" model="ir.actions.act_window">
365             <field name="name">Purchase Orders</field>
366             <field name="type">ir.actions.act_window</field>
367             <field name="res_model">purchase.order</field>
368             <field name="view_mode">tree,form,graph,calendar</field>
369             <field name="context">{'search_default_approved': 1}</field>
370             <field name="search_view_id" ref="view_purchase_order_filter"/>
371             <field name="help">Use this menu to search within your purchase orders by references, supplier, products, etc. For each purchase order, you can track the products received, and control the supplier invoices.</field>
372         </record>
373         <menuitem action="purchase_form_action" id="menu_purchase_form_action" parent="menu_procurement_management" sequence="6"/>
374
375         <record id="purchase_order_line_form" model="ir.ui.view">
376             <field name="name">purchase.order.line.form</field>
377             <field name="model">purchase.order.line</field>
378             <field name="type">form</field>
379             <field name="arch" type="xml">
380                 <form string="Purchase Order Line" version="7.0">
381                     <sheet>
382                         <group>
383                             <group>
384                                 <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,context)"/>
385                                 <label for="product_qty"/>
386                                 <div>
387                                     <field name="product_qty" on_change="onchange_product_id(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id,parent.date_order,parent.fiscal_position,date_planned,name,price_unit,context)" class="oe_inline"/>
388                                     <field name="product_uom" groups="product.group_uom" on_change="onchange_product_uom(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,context)" class="oe_inline"/>
389                                 </div>
390                                 <field name="price_unit"/>
391                             </group>
392                             <group>
393                                 <field name="taxes_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
394                                 <field name="date_planned" widget="date"/>
395                                 <field name="account_analytic_id" colspan="2" groups="purchase.group_analytic_accounting" domain="[('parent_id','!=',False)]" />
396                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
397                             </group>
398                         </group>
399                         <notebook>
400                         <page string="Notes">
401                             <field name="name"/>
402                         </page><page string="Invoices and Receptions">
403                             <field name="invoice_lines"/>
404                             <field name="move_ids"/>
405                         </page>
406                         </notebook>
407                     </sheet>
408                 </form>
409             </field>
410         </record>
411
412         <record id="purchase_order_line_tree" model="ir.ui.view">
413             <field name="name">purchase.order.line.tree</field>
414             <field name="model">purchase.order.line</field>
415             <field name="type">tree</field>
416             <field name="arch" type="xml">
417                 <tree string="Purchase Order Lines">
418                     <field name="order_id"/>
419                     <field name="name"/>
420                     <field name="partner_id" string="Supplier" />
421                     <field name="product_id"/>
422                     <field name="price_unit"/>
423                     <field name="product_qty"/>
424                     <field name="product_uom" groups="product.group_uom"/>
425                     <field name="price_subtotal"/>
426                     <field name="date_planned"  widget="date" width="135"/>
427                     <field name="state" invisible="1"/>
428                     <field name="invoiced" invisible="1"/>
429                 </tree>
430             </field>
431         </record>
432         <record id="purchase_order_line_form2" model="ir.ui.view">
433             <field name="name">purchase.order.line.form2</field>
434             <field name="model">purchase.order.line</field>
435             <field name="type">form</field>
436             <field name="priority" eval="20"/>
437             <field name="arch" type="xml">
438                 <form string="Purchase Order Line" version="7.0">
439                     <sheet>
440                         <label for="order_id" class="oe_edit_only"/>
441                         <h1>
442                             <field name="order_id" class="oe_inline"/>
443                             <label string="," attrs="{'invisible':[('date_order','=',False)]}"/>
444                             <field name="date_order" class="oe_inline"/>
445                         </h1>
446                         <label for="partner_id" class="oe_edit_only"/>
447                         <h2><field name="partner_id"/></h2>
448                         <group>
449                             <group>
450                                 <field name="product_id" readonly="1"/>
451                                 <label for="product_qty"/>
452                                 <div>
453                                     <field name="product_qty" readonly="1" class="oe_inline"/>
454                                     <field name="product_uom" readonly="1" groups="product.group_uom" class="oe_inline"/>
455                                 </div>
456                                 <field name="price_unit"/>
457                             </group>
458                             <group>
459                                 <field name="taxes_id" widget="many2many_tags"
460                                     domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
461                                 <field name="date_planned" widget="date" readonly="1"/>
462                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
463                                 <field name="account_analytic_id" colspan="4" groups="purchase.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
464                                 <field name="invoiced"/>
465                             </group>
466                         </group>
467                         <field name="name"/>
468                         <separator string="Manual Invoices"/>
469                         <field name="invoice_lines"/>
470                         <separator string="Stock Moves"/>
471                         <field name="move_ids"/>
472                     </sheet>
473                 </form>
474             </field>
475         </record>
476           <record id="purchase_order_line_search" model="ir.ui.view">
477             <field name="name">purchase.order.line.search</field>
478             <field name="model">purchase.order.line</field>
479             <field name="type">search</field>
480             <field name="arch" type="xml">
481                 <search string="Search Purchase Order">
482                     <field name="order_id"/>
483                     <field name="product_id"/>
484                     <field name="partner_id" string="Supplier"/>
485                     <group expand="0" string="Group By...">
486                         <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by' : 'partner_id'}" />
487                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by' : 'product_id'}" />
488                         <filter icon="terp-gtk-jump-to-rtl" string="Order Reference" domain="[]" context="{'group_by' :'order_id'}"/>
489                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by' : 'state'}" />
490                     </group>
491                 </search>
492             </field>
493         </record>
494
495         <act_window
496             context="{'search_default_partner_id': [active_id], 'default_partner_id': active_id}"
497             id="act_res_partner_2_purchase_order"
498             name="RFQs and Purchases"
499             groups="purchase.group_purchase_user"
500             res_model="purchase.order"
501             src_model="res.partner"/>
502
503         <act_window
504             context="{'search_default_product_id': [active_id], 'default_product_id': active_id}"
505             id="action_purchase_line_product_tree"
506             name="Purchases"
507             res_model="purchase.order.line"
508             src_model="product.product"
509             groups="purchase.group_purchase_user"/>
510
511
512         <record id="purchase_line_form_action2" model="ir.actions.act_window">
513             <field name="name">Based on Purchase Order Lines</field>
514             <field name="type">ir.actions.act_window</field>
515             <field name="res_model">purchase.order.line</field>
516             <field name="domain">[('order_id.invoice_method','&lt;&gt;','picking'), ('state','in',('confirmed','done')), ('invoiced', '=', False)]</field>
517             <field name="view_type">form</field>
518             <field name="view_mode">tree,form</field>
519             <field name="search_view_id" ref="purchase_order_line_search"/>
520             <field name="help">
521                 Here you can track all the lines of purchase orders where the invoicing is "Based on Purchase Order Lines",
522                 and for which you have not received a supplier invoice yet.
523                 You can generate a draft supplier invoice based on the lines from this list.
524             </field>
525         </record>
526         <record id="purchase_line_form_action_tree2" model="ir.actions.act_window.view">
527             <field eval="1" name="sequence"/>
528             <field name="view_mode">tree</field>
529             <field name="view_id" ref="purchase_order_line_tree"/>
530             <field name="act_window_id" ref="purchase_line_form_action2"/>
531         </record>
532         <record id="purchase_line_form_action_form2" model="ir.actions.act_window.view">
533             <field eval="2" name="sequence"/>
534             <field name="view_mode">form</field>
535             <field name="view_id" ref="purchase_order_line_form2"/>
536             <field name="act_window_id" ref="purchase_line_form_action2"/>
537         </record>
538         <menuitem
539             action="purchase_line_form_action2"
540             id="menu_purchase_line_order_draft"
541             parent="menu_procurement_management_invoice"
542             sequence="72"/>
543
544         <!-- Procurements -->
545
546         <record id="view_procurement_form_inherit" model="ir.ui.view">
547             <field name="name">procurement.order.form.inherit</field>
548             <field name="model">procurement.order</field>
549             <field name="inherit_id" ref="procurement.procurement_form_view"/>
550             <field name="type">form</field>
551             <field name="arch" type="xml">
552                 <xpath expr="//field[@name='close_move']" position="before">
553                     <field name="purchase_id"/>
554                 </xpath>
555             </field>
556         </record>
557     </data>
558 </openerp>