[FIX] Autofocus on create mode
[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="fiscal_position"/>
249                                     <!-- We do not need these fields anymore, the information is in open chatter -->
250                                     <field name="validator" groups="base.group_no_one"/>
251                                     <field name="date_approve" groups="base.group_no_one"/>
252                                 </group>
253                             </group>
254                             <separator string="Invoices"/>
255                             <field name="invoice_ids" context="{'type':'in_invoice', 'journal_type':'purchase'}"/>
256                         </page>
257                     </notebook>
258                 </sheet>
259                 <div class="oe_chatter">
260                     <field name="message_ids" widget="mail_thread"/>
261                 </div>
262                 </form>
263             </field>
264         </record>
265
266        <record id="view_request_for_quotation_filter" model="ir.ui.view">
267             <field name="name">request.quotation.select</field>
268             <field name="model">purchase.order</field>
269             <field name="type">search</field>
270             <field name="arch" type="xml">
271                 <search string="Search Purchase Order">
272                     <field name="name" string="Reference"/>
273                     <filter icon="terp-document-new" name="draft" string="Quotations" domain="[('state','=','draft')]" help="Purchase order which are in draft state"/>
274                     <filter icon="terp-check" name="approved" string="Approved" domain="[('state','in',('approved','done'))]" help="Approved purchase order"/>
275                     <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"/>
276                     <separator/>
277                     <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."/>
278                     <field name="partner_id"/>
279                     <field name="product_id"/>
280                     <field name="create_uid"/>
281                     <group expand="0" string="Group By...">
282                         <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
283                         <filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
284                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
285                         <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
286                         <filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'minimum_planned_date'}"/>
287                     </group>
288                 </search>
289             </field>
290         </record>
291
292         <record id="view_purchase_order_filter" model="ir.ui.view">
293             <field name="name">purchase.order.list.select</field>
294             <field name="model">purchase.order</field>
295             <field name="type">search</field>
296             <field name="arch" type="xml">
297                 <search string="Search Purchase Order">
298                     <field name="name" string="Reference"/>
299                     <filter icon="terp-mail-message-new" string="Inbox" help="Unread messages" name="needaction_pending" domain="[('needaction_pending','=',True)]"/>
300                     <separator/>
301                     <filter icon="terp-document-new" name="draft" string="Quotations" domain="[('state','=','draft')]" help="Purchase orders which are in draft state"/>
302                     <filter icon="terp-check" name="approved" string="Purchase Orders" domain="[('state','not in',('draft','cancel'))]" help="Approved purchase orders"/>
303                     <filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase orders which are in exception state"/>
304                     <separator/>
305                     <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."/>
306                     <field name="partner_id"/>
307                     <field name="product_id"/>
308                     <field name="create_uid"/>
309                     <group expand="0" string="Group By...">
310                         <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
311                         <filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
312                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
313                         <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
314                         <filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'minimum_planned_date'}"/>
315                     </group>
316                 </search>
317             </field>
318         </record>
319
320         <record id="purchase_order_tree" model="ir.ui.view">
321             <field name="name">purchase.order.tree</field>
322             <field name="model">purchase.order</field>
323             <field name="type">tree</field>
324             <field name="arch" type="xml">
325                 <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">
326                     <field name="needaction_pending" invisible="1"/>
327                     <field name="name" string="Reference"/>
328                     <field name="date_order" />
329                     <field name="partner_id"/>
330                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
331                     <field name="minimum_planned_date" invisible="context.get('quotation_only', False)"/>
332                     <field name="origin"/>
333                     <field name="invoiced_rate" widget="progressbar" invisible="context.get('quotation_only', False)"/>
334                     <field name="shipped_rate" widget="progressbar" invisible="context.get('quotation_only', False)"/>
335                     <field name="amount_untaxed" sum="Total Untaxed amount"/>
336                     <field name="amount_total" sum="Total amount"/>
337                     <field name="state"/>
338                 </tree>
339             </field>
340         </record>
341
342         <record id="purchase_rfq" model="ir.actions.act_window">
343             <field name="name">Quotations</field>
344             <field name="type">ir.actions.act_window</field>
345             <field name="res_model">purchase.order</field>
346             <field name="context">{'search_default_draft': 1}</field>
347             <field name="view_mode">tree,form,graph,calendar</field>
348             <field name="search_view_id" ref="view_purchase_order_filter"/>
349             <field name="help">
350                 Create a request for quotation when you want to buy products from a supplier.
351                 You can also use this menu to review requests for quotation created automatically
352                 (based on logistic rules, like minimum stock, MTO, etc.)
353                 &lt;p&gt;
354                 Once confirmed, a request for quotation becomes a purchase order.
355                 In the Purchase Settings, you can select the way to control supplier invoicing:
356                 based on the order, based on receptions, or manual.
357             </field>
358         </record>
359         <menuitem action="purchase_rfq" id="menu_purchase_rfq"
360             parent="menu_procurement_management"
361             sequence="0"/>
362
363         <record id="purchase_form_action" model="ir.actions.act_window">
364             <field name="name">Purchase Orders</field>
365             <field name="type">ir.actions.act_window</field>
366             <field name="res_model">purchase.order</field>
367             <field name="view_mode">tree,form,graph,calendar</field>
368             <field name="context">{'search_default_approved': 1}</field>
369             <field name="search_view_id" ref="view_purchase_order_filter"/>
370             <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>
371         </record>
372         <menuitem action="purchase_form_action" id="menu_purchase_form_action" parent="menu_procurement_management" sequence="6"/>
373
374         <record id="purchase_order_line_form" model="ir.ui.view">
375             <field name="name">purchase.order.line.form</field>
376             <field name="model">purchase.order.line</field>
377             <field name="type">form</field>
378             <field name="arch" type="xml">
379                 <form string="Purchase Order Line" version="7.0">
380                     <sheet>
381                         <group>
382                             <group>
383                                 <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)"/>
384                                 <label for="product_qty"/>
385                                 <div>
386                                     <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"/>
387                                     <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"/>
388                                 </div>
389                                 <field name="price_unit"/>
390                             </group>
391                             <group>
392                                 <field name="taxes_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
393                                 <field name="date_planned" widget="date"/>
394                                 <field name="account_analytic_id" colspan="2" groups="purchase.group_analytic_accounting" domain="[('parent_id','!=',False)]" />
395                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
396                             </group>
397                         </group>
398                         <notebook>
399                         <page string="Notes">
400                             <field name="name"/>
401                         </page><page string="Invoices and Receptions">
402                             <field name="invoice_lines"/>
403                             <field name="move_ids"/>
404                         </page>
405                         </notebook>
406                     </sheet>
407                 </form>
408             </field>
409         </record>
410
411         <record id="purchase_order_line_tree" model="ir.ui.view">
412             <field name="name">purchase.order.line.tree</field>
413             <field name="model">purchase.order.line</field>
414             <field name="type">tree</field>
415             <field name="arch" type="xml">
416                 <tree string="Purchase Order Lines">
417                     <field name="order_id"/>
418                     <field name="name"/>
419                     <field name="partner_id" string="Supplier" />
420                     <field name="product_id"/>
421                     <field name="price_unit"/>
422                     <field name="product_qty"/>
423                     <field name="product_uom" groups="product.group_uom"/>
424                     <field name="price_subtotal"/>
425                     <field name="date_planned"  widget="date" width="135"/>
426                     <field name="state" invisible="1"/>
427                     <field name="invoiced" invisible="1"/>
428                 </tree>
429             </field>
430         </record>
431         <record id="purchase_order_line_form2" model="ir.ui.view">
432             <field name="name">purchase.order.line.form2</field>
433             <field name="model">purchase.order.line</field>
434             <field name="type">form</field>
435             <field name="priority" eval="20"/>
436             <field name="arch" type="xml">
437                 <form string="Purchase Order Line" version="7.0">
438                     <sheet>
439                         <label for="order_id" class="oe_edit_only"/>
440                         <h1>
441                             <field name="order_id" class="oe_inline"/>
442                             <label string="," attrs="{'invisible':[('date_order','=',False)]}"/>
443                             <field name="date_order" class="oe_inline"/>
444                         </h1>
445                         <label for="partner_id" class="oe_edit_only"/>
446                         <h2><field name="partner_id"/></h2>
447                         <group>
448                             <group>
449                                 <field name="product_id" readonly="1"/>
450                                 <label for="product_qty"/>
451                                 <div>
452                                     <field name="product_qty" readonly="1" class="oe_inline"/>
453                                     <field name="product_uom" readonly="1" groups="product.group_uom" class="oe_inline"/>
454                                 </div>
455                                 <field name="price_unit"/>
456                             </group>
457                             <group>
458                                 <field name="taxes_id" widget="many2many_tags"
459                                     domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
460                                 <field name="date_planned" widget="date" readonly="1"/>
461                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
462                                 <field name="account_analytic_id" colspan="4" groups="purchase.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
463                                 <field name="invoiced"/>
464                             </group>
465                         </group>
466                         <field name="name"/>
467                         <separator string="Manual Invoices"/>
468                         <field name="invoice_lines"/>
469                         <separator string="Stock Moves"/>
470                         <field name="move_ids"/>
471                     </sheet>
472                 </form>
473             </field>
474         </record>
475           <record id="purchase_order_line_search" model="ir.ui.view">
476             <field name="name">purchase.order.line.search</field>
477             <field name="model">purchase.order.line</field>
478             <field name="type">search</field>
479             <field name="arch" type="xml">
480                 <search string="Search Purchase Order">
481                     <field name="order_id"/>
482                     <field name="product_id"/>
483                     <field name="partner_id" string="Supplier"/>
484                     <group expand="0" string="Group By...">
485                         <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by' : 'partner_id'}" />
486                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by' : 'product_id'}" />
487                         <filter icon="terp-gtk-jump-to-rtl" string="Order Reference" domain="[]" context="{'group_by' :'order_id'}"/>
488                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by' : 'state'}" />
489                     </group>
490                 </search>
491             </field>
492         </record>
493
494         <act_window
495             context="{'search_default_partner_id': [active_id], 'default_partner_id': active_id}"
496             id="act_res_partner_2_purchase_order"
497             name="RFQs and Purchases"
498             groups="purchase.group_purchase_user"
499             res_model="purchase.order"
500             src_model="res.partner"/>
501
502         <act_window
503             context="{'search_default_product_id': [active_id], 'default_product_id': active_id}"
504             id="action_purchase_line_product_tree"
505             name="Purchases"
506             res_model="purchase.order.line"
507             src_model="product.product"
508             groups="purchase.group_purchase_user"/>
509
510
511         <record id="purchase_line_form_action2" model="ir.actions.act_window">
512             <field name="name">Based on Purchase Order Lines</field>
513             <field name="type">ir.actions.act_window</field>
514             <field name="res_model">purchase.order.line</field>
515             <field name="domain">[('order_id.invoice_method','&lt;&gt;','picking'), ('state','in',('confirmed','done')), ('invoiced', '=', False)]</field>
516             <field name="view_type">form</field>
517             <field name="view_mode">tree,form</field>
518             <field name="search_view_id" ref="purchase_order_line_search"/>
519             <field name="help">
520                 Here you can track all the lines of purchase orders where the invoicing is "Based on Purchase Order Lines",
521                 and for which you have not received a supplier invoice yet.
522                 You can generate a draft supplier invoice based on the lines from this list.
523             </field>
524         </record>
525         <record id="purchase_line_form_action_tree2" model="ir.actions.act_window.view">
526             <field eval="1" name="sequence"/>
527             <field name="view_mode">tree</field>
528             <field name="view_id" ref="purchase_order_line_tree"/>
529             <field name="act_window_id" ref="purchase_line_form_action2"/>
530         </record>
531         <record id="purchase_line_form_action_form2" model="ir.actions.act_window.view">
532             <field eval="2" name="sequence"/>
533             <field name="view_mode">form</field>
534             <field name="view_id" ref="purchase_order_line_form2"/>
535             <field name="act_window_id" ref="purchase_line_form_action2"/>
536         </record>
537         <menuitem
538             action="purchase_line_form_action2"
539             id="menu_purchase_line_order_draft"
540             parent="menu_procurement_management_invoice"
541             sequence="72"/>
542
543         <!-- Procurements -->
544
545         <record id="view_procurement_form_inherit" model="ir.ui.view">
546             <field name="name">procurement.order.form.inherit</field>
547             <field name="model">procurement.order</field>
548             <field name="inherit_id" ref="procurement.procurement_form_view"/>
549             <field name="type">form</field>
550             <field name="arch" type="xml">
551                 <xpath expr="//field[@name='close_move']" position="before">
552                     <field name="purchase_id"/>
553                 </xpath>
554             </field>
555         </record>
556     </data>
557 </openerp>