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