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