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