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