Merge with addons/trunk revno 8168.
[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="60"/>
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         <menuitem
18             action="product.product_pricelist_action_for_purchase" id="menu_product_pricelist_action2_purchase"
19             parent="menu_purchase_config_purchase" sequence="10" groups="product.group_purchase_pricelist" />
20
21         <record id="purchase_pricelist_version_action" model="ir.actions.act_window">
22             <field name="name">Pricelist Versions</field>
23             <field name="type">ir.actions.act_window</field>
24             <field name="res_model">product.pricelist.version</field>
25             <field name="view_type">form</field>
26             <field name="view_id" ref="product.product_pricelist_version_tree_view"/>
27             <field name="domain">[('pricelist_id.type','=','purchase')]</field>
28             <field name="help" type="html">
29               <p class="oe_view_nocontent_create">
30                 Click to add a pricelist version.
31               </p><p>
32                 There can be more than one version of a pricelist, each of
33                 these must be valid during a certain period of time. Some
34                 examples of versions: Main Prices, 2010, 2011, Summer Sales,
35                 etc.
36               </p>
37             </field>
38         </record>
39         <menuitem
40             id="menu_purchase_config_pricelist" name="Pricelists"
41             parent="menu_purchase_config_purchase" sequence="50" groups="product.group_purchase_pricelist"/>
42
43         <menuitem
44             action="purchase_pricelist_version_action" id="menu_purchase_pricelist_version_action"
45             parent="menu_purchase_config_pricelist" sequence="2" groups="product.group_purchase_pricelist"/>
46
47         
48         <menuitem
49             action="product.product_price_type_action" id="menu_product_pricelist_action2_purchase_type"
50             parent="menu_purchase_config_pricelist" sequence="60" />
51         <menuitem
52             id="menu_product_in_config_purchase" name="Products"
53             parent="menu_purchase_config_purchase" sequence="30" groups="base.group_no_one"/>
54
55         <menuitem
56             action="product.product_category_action_form" id="menu_product_category_config_purchase"
57             parent="purchase.menu_product_in_config_purchase" sequence="1" />
58
59         <menuitem
60             id="menu_purchase_unit_measure_purchase" name="Units of Measure"
61             parent="purchase.menu_product_in_config_purchase"  sequence="20" groups="product.group_uom"/>
62
63         <menuitem
64              action="product.product_uom_categ_form_action" id="menu_purchase_uom_categ_form_action"
65              parent="purchase.menu_product_in_config_purchase" sequence="5" />
66
67         <menuitem
68               action="product.product_uom_form_action" id="menu_purchase_uom_form_action"
69               parent="purchase.menu_product_in_config_purchase" sequence="10"/>
70
71         <menuitem
72             id="menu_purchase_partner_cat" name="Address Book"
73             parent="menu_purchase_config_purchase"/>
74
75         <menuitem
76             action="base.action_partner_category_form" id="menu_partner_categories_in_form" name="Partner Categories"
77             parent="purchase.menu_purchase_partner_cat" groups="base.group_no_one"/>
78
79     <!--Supplier menu-->
80     <menuitem id="base.menu_procurement_management_supplier_name" name="Suppliers"
81         parent="menu_procurement_management"
82         action="base.action_partner_supplier_form" sequence="15"/>
83
84       <!--Inventory control-->
85       <menuitem id="menu_procurement_management_inventory" name="Incoming Products"
86             parent="base.menu_purchase_root" sequence="4"/>
87       <menuitem action="stock.action_picking_tree4" id="menu_action_picking_tree4" parent="menu_procurement_management_inventory"
88             name="Incoming Shipments" sequence="9"/>
89       <menuitem action="stock.action_reception_picking_move" id="menu_action_picking_tree_in_move"
90             parent="menu_procurement_management_inventory" sequence="11"/>
91
92     <!--Invoice control-->
93     <menuitem id="menu_procurement_management_invoice" name="Invoice Control"
94         parent="base.menu_purchase_root" sequence="6"/>
95
96     <record id="action_invoice_pending" model="ir.actions.act_window">
97         <field name="name">On Draft Invoices</field>
98         <field name="res_model">account.invoice</field>
99         <field name="view_type">form</field>
100         <field name="view_mode">tree,form,calendar,graph</field>
101         <field eval="False" name="view_id"/>
102         <field name="domain">[('type','=','in_invoice')]</field>
103         <field name="context">{'default_type':'in_invoice', 'type':'in_invoice', 'journal_type': 'purchase', 'search_default_draft': 1}</field>
104         <field name="search_view_id" ref="account.view_account_invoice_filter"/>
105         <field name="help" type="html">
106           <p class="oe_view_nocontent_create">
107             Click to create a draft invoice.
108           </p><p>
109             Use this menu to control the invoices to be received from your
110             supplier. OpenERP generates draft invoices from your purchase
111             orders or receptions, according to your settings.
112           </p><p>
113             Once you receive a supplier invoice, you can match it with the
114             draft invoice and validate it.
115           </p>
116         </field>
117     </record>
118
119      <menuitem
120           id="menu_procurement_management_pending_invoice"
121           action="action_invoice_pending"
122           parent="menu_procurement_management_invoice"
123           sequence="13"/>
124
125       <!-- Product menu-->
126       <menuitem id="menu_procurement_management_product" name="Products"
127           parent="base.menu_purchase_root" sequence="8"/>
128
129       <menuitem name="Products by Category" id="menu_product_by_category_purchase_form" action="product.product_category_action"
130            parent="menu_procurement_management_product" sequence="10"/>
131
132       <menuitem name="Products" id="menu_procurement_partner_contact_form" action="product.product_normal_action_puchased"
133           parent="menu_procurement_management_product"/>
134
135         <!-- Purchase order Read/Unread actions -->
136         <record id="actions_server_purchase_order_unread" model="ir.actions.server">
137             <field name="name">Purchase: Mark unread</field>
138             <field name="condition">True</field>
139             <field name="type">ir.actions.server</field>
140             <field name="model_id" ref="model_purchase_order"/>
141             <field name="state">code</field>
142             <field name="code">self.message_mark_as_unread(cr, uid, context.get('active_ids'), context=context)</field>
143         </record>
144         <record id="action_purchase_order_unread" model="ir.values">
145             <field name="name">action_purchase_order_unread</field>
146             <field name="action_id" ref="actions_server_purchase_order_unread"/>
147             <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_purchase_order_unread'))" />
148             <field name="key">action</field>
149             <field name="model_id" ref="model_purchase_order" />
150             <field name="model">purchase.order</field>
151             <field name="key2">client_action_multi</field>
152         </record>
153
154         <record id="actions_server_purchase_order_read" model="ir.actions.server">
155             <field name="name">Purchase: Mark read</field>
156             <field name="condition">True</field>
157             <field name="type">ir.actions.server</field>
158             <field name="model_id" ref="model_purchase_order"/>
159             <field name="state">code</field>
160             <field name="code">self.message_mark_as_read(cr, uid, context.get('active_ids'), context=context)</field>
161         </record>
162         <record id="action_purchase_order_read" model="ir.values">
163             <field name="name">action_purchase_order_read</field>
164             <field name="action_id" ref="actions_server_purchase_order_read"/>
165             <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_purchase_order_read'))" />
166             <field name="key">action</field>
167             <field name="model_id" ref="model_purchase_order" />
168             <field name="model">purchase.order</field>
169             <field name="key2">client_action_multi</field>
170         </record>
171
172         <record model="ir.ui.view" id="purchase_order_calendar">
173             <field name="name">purchase.order.calendar</field>
174             <field name="model">purchase.order</field>
175             <field name="priority" eval="2"/>
176             <field name="arch" type="xml">
177                 <calendar string="Calendar View" date_start="minimum_planned_date" color="partner_id">
178                     <field name="name"/>
179                     <field name="amount_total"/>
180                     <field name="partner_id"/>
181                 </calendar>
182             </field>
183         </record>
184         <record model="ir.ui.view" id="purchase_order_graph">
185             <field name="name">purchase.order.graph</field>
186             <field name="model">purchase.order</field>
187             <field name="arch" type="xml">
188                 <graph string="Purchase Order" type="bar">
189                     <field name="partner_id"/>
190                     <field name="amount_total" operator="+"/>
191                 </graph>
192             </field>
193         </record>
194
195         <record id="purchase_order_form" model="ir.ui.view">
196             <field name="name">purchase.order.form</field>
197             <field name="model">purchase.order</field>
198             <field name="arch" type="xml">
199                 <form string="Purchase Order" version="7.0">
200                 <header>
201                     <button name="wkf_send_rfq" states="draft" string="Send by EMail" type="object" context="{'send_rfq':True}" class="oe_highlight"/>
202                     <button name="wkf_send_rfq" states="sent" string="Send by EMail" type="object" context="{'send_rfq':True}"/>
203                     <button name="print_quotation" string="Print" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
204                     <button name="print_quotation" string="Print" type="object" states="sent" groups="base.group_user"/>
205                     <button name="purchase_confirm" states="draft" string="Confirm Order"/>
206                     <button name="purchase_confirm" states="sent" string="Confirm Order" class="oe_highlight"/>
207                     <button name="wkf_send_rfq" states="confirmed" string="Resend Purchase Order" type="object" class="oe_highlight"/>
208                     <button name="action_cancel" states="except_picking,except_invoice" string="Cancel" type="object" />
209                     <button name="picking_ok" states="except_picking" string="Manually Corrected"/>
210                     <button name="invoice_ok" states="except_invoice" string="Manually Corrected"/>
211                     <button name="purchase_approve" states="confirmed" string="Approve Order" class="oe_highlight" groups="purchase.group_purchase_manager"/>
212                     <button name="view_picking" string="Receive Products" type="object" attrs="{'invisible': ['|', ('shipped','=',True), ('state','!=', 'approved')]}" class="oe_highlight"/>
213                     <button name="view_invoice" string="Receive Invoice" type="object" attrs="{'invisible': ['|', ('invoice_method','=','picking'), '|', ('state','!=', 'approved'), ('invoiced','=',True) ]}" class="oe_highlight"/>
214                     <button name="action_cancel_draft" states="cancel,sent,confirmed" string="Set to Draft" type="object" />
215                     <button name="purchase_cancel" states="draft,confirmed,sent" string="Cancel"/>
216                     <field name="state" widget="statusbar" statusbar_visible="draft,sent,approved,done" statusbar_colors='{"except_picking":"red","except_invoice":"red","confirmed":"blue"}' readonly="1"/>
217                 </header>
218                 <sheet>
219                     <div class="oe_title">
220                         <h1>
221                             <label string="Quotation " attrs="{'invisible': [('state','not in',('draft','sent'))]}"/>
222                             <label string="Purchase Order " attrs="{'invisible': [('state','in',('draft','sent'))]}"/>
223                             <field name="name" class="oe_inline" readonly="1"/>
224                         </h1>
225                     </div>
226                     <group>
227                         <group>
228                             <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)]"/>
229                             <field name="partner_ref"/>
230                             <field domain="[('type','=','purchase')]" name="pricelist_id" groups="product.group_purchase_pricelist" on_change="onchange_pricelist(pricelist_id, context)"/>
231                             <field name="currency_id" invisible='1'/>
232                             <field name="journal_id" invisible='1'/>
233                         </group>
234                         <group>
235                             <field name="date_order"/>
236                             <field name="origin" attr="{'invisible': [('origin','=',False)]}"/>
237                             <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection" groups="stock.group_locations"/>
238                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
239                         </group>
240                     </group>
241                     <notebook>
242                         <page string="Purchase Order">
243                             <field name="order_line">
244                                 <tree string="Purchase Order Lines" editable="bottom">
245                                     <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)"/>
246                                     <field name="name"/>
247                                     <field name="date_planned"/>
248                                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
249                                     <field name="account_analytic_id" groups="purchase.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
250                                     <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)"/>
251                                     <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)"/>
252                                     <field name="price_unit"/>
253                                     <field name="taxes_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
254                                     <field name="price_subtotal"/>
255                                 </tree>
256                             </field>
257                             <group class="oe_subtotal_footer oe_right">
258                                 <field name="amount_untaxed" widget="monetary" options="{'currency_field': 'currency_id'}"/>
259                                 <field name="amount_tax" widget="monetary" options="{'currency_field': 'currency_id'}"/>
260                                 <div class="oe_subtotal_footer_separator oe_inline">
261                                     <label for="amount_total"/>
262                                     <button name="button_dummy"
263                                         states="draft" string="(update)" type="object" class="oe_edit_only oe_link"/>
264                                 </div>
265                                 <field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>
266                             </group>
267                             <div class="oe_clear"/>
268                             <field name="notes" class="oe_inline" placeholder="Terms and conditions..."/>
269                         </page>
270                         <page string="Incoming Shipments &amp; Invoices">
271                             <group>
272                                 <group>
273                                     <field name="dest_address_id" string="Customer Address" on_change="onchange_dest_address_id(dest_address_id)" groups="stock.group_locations"/>
274                                     <field name="minimum_planned_date"/>
275                                     <field name="location_id" groups="stock.group_locations"/>
276                                     <field name="shipped" groups="base.group_no_one"/>
277                                 </group>
278                                 <group>
279                                     <field name="invoice_method"/>
280                                     <field name="invoiced"/>
281                                     <field name="payment_term" widget="selection"/>
282                                     <field name="fiscal_position"/>
283                                     <!-- We do not need these fields anymore, the information is in open chatter -->
284                                     <field name="validator" groups="base.group_no_one"/>
285                                     <field name="date_approve" groups="base.group_no_one"/>
286                                 </group>
287                             </group>
288                         </page>
289                     </notebook>
290                 </sheet>
291                 <div class="oe_chatter">
292                     <field name="message_follower_ids" widget="mail_followers"/>
293                     <field name="message_ids" widget="mail_thread"/>
294                 </div>
295                 </form>
296             </field>
297         </record>
298
299        <record id="view_request_for_quotation_filter" model="ir.ui.view">
300             <field name="name">request.quotation.select</field>
301             <field name="model">purchase.order</field>
302             <field name="arch" type="xml">
303                 <search string="Search Purchase Order">
304                     <field name="name" string="Reference"/>
305                     <filter icon="terp-document-new" name="draft" string="Quotations" domain="[('state','=','draft')]" help="Purchase order which are in draft state"/>
306                     <filter icon="terp-check" name="approved" string="Approved" domain="[('state','in',('approved','done'))]" help="Approved purchase order"/>
307                     <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"/>
308                     <separator/>
309                     <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."/>
310                     <field name="partner_id"/>
311                     <field name="product_id"/>
312                     <field name="create_uid"/>
313                     <group expand="0" string="Group By...">
314                         <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
315                         <filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
316                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
317                         <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
318                         <filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'minimum_planned_date'}"/>
319                     </group>
320                 </search>
321             </field>
322         </record>
323
324         <record id="view_purchase_order_filter" model="ir.ui.view">
325             <field name="name">purchase.order.list.select</field>
326             <field name="model">purchase.order</field>
327             <field name="arch" type="xml">
328                 <search string="Search Purchase Order">
329                     <field name="name" string="Reference"/>
330                     <filter icon="terp-mail-message-new" string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
331                     <separator/>
332                     <filter icon="terp-document-new" name="draft" string="Quotations" domain="[('state','=','draft')]" help="Purchase orders which are in draft state"/>
333                     <filter icon="terp-check" name="approved" string="Purchase Orders" domain="[('state','not in',('draft','cancel'))]" help="Approved purchase orders"/>
334                     <filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase orders which are in exception state"/>
335                     <separator/>
336                     <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."/>
337                     <field name="partner_id"/>
338                     <field name="product_id"/>
339                     <field name="create_uid"/>
340                     <group expand="0" string="Group By...">
341                         <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
342                         <filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
343                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
344                         <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
345                         <filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'minimum_planned_date'}"/>
346                     </group>
347                 </search>
348             </field>
349         </record>
350
351         <record id="purchase_order_tree" model="ir.ui.view">
352             <field name="name">purchase.order.tree</field>
353             <field name="model">purchase.order</field>
354             <field name="arch" type="xml">
355                 <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">
356                     <field name="message_unread" invisible="1"/>
357                     <field name="name" string="Reference"/>
358                     <field name="date_order" />
359                     <field name="partner_id"/>
360                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
361                     <field name="minimum_planned_date" invisible="context.get('quotation_only', False)"/>
362                     <field name="origin"/>
363                     <field name="amount_untaxed" sum="Total Untaxed amount" string="Untaxed"/>
364                     <field name="amount_total" sum="Total amount"/>
365                     <field name="state"/>
366                 </tree>
367             </field>
368         </record>
369
370         <record id="purchase_rfq" model="ir.actions.act_window">
371             <field name="name">Quotations</field>
372             <field name="type">ir.actions.act_window</field>
373             <field name="res_model">purchase.order</field>
374             <field name="context">{'search_default_draft': 1, 'search_default_to_approve': 1}</field>
375             <field name="domain">[('state','in',('draft','sent','confirmed'))]</field>
376             <field name="view_mode">tree,form,graph,calendar</field>
377             <field name="search_view_id" ref="view_purchase_order_filter"/>
378             <field name="help" type="html">
379               <p class="oe_view_nocontent_create">
380                 Click to create a request for quotation.
381               </p><p>
382                 The quotation contains the history of the discussion/negociation
383                 you had with your supplier. Once confirmed, a request for
384                 quotation is converted into a purchase order.
385               </p><p>
386                 Most propositions of purchase orders are created automatically
387                 by OpenERP based on inventory needs.
388               </p>
389             </field>
390         </record>
391         <menuitem action="purchase_rfq" id="menu_purchase_rfq"
392             parent="menu_procurement_management"
393             sequence="0"/>
394
395         <record id="purchase_form_action" model="ir.actions.act_window">
396             <field name="name">Purchase Orders</field>
397             <field name="type">ir.actions.act_window</field>
398             <field name="res_model">purchase.order</field>
399             <field name="view_mode">tree,form,graph,calendar</field>
400             <field name="context">{}</field>
401             <field name="domain">[('state','not in',('draft','sent','confirmed'))]</field>
402             <field name="search_view_id" ref="view_purchase_order_filter"/>
403             <field name="help" type="html">
404               <p class="oe_view_nocontent_create">
405                 Click to create a quotation that will be converted into a purchase order. 
406               </p><p>
407                 Use this menu to search within your purchase orders by
408                 references, supplier, products, etc. For each purchase order,
409                 you can track the related discussion with the supplier, control
410                 the products received and control the supplier invoices.
411               </p>
412             </field>
413         </record>
414         <menuitem action="purchase_form_action" id="menu_purchase_form_action" parent="menu_procurement_management" sequence="6"/>
415
416         <record id="purchase_order_line_form" model="ir.ui.view">
417             <field name="name">purchase.order.line.form</field>
418             <field name="model">purchase.order.line</field>
419             <field name="arch" type="xml">
420                 <form string="Purchase Order Line" version="7.0">
421                     <sheet>
422                         <group>
423                             <group>
424                                 <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)"/>
425                                 <label for="product_qty"/>
426                                 <div>
427                                     <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"/>
428                                     <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"/>
429                                 </div>
430                                 <field name="price_unit"/>
431                             </group>
432                             <group>
433                                 <field name="taxes_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
434                                 <field name="date_planned" widget="date"/>
435                                 <field name="account_analytic_id" colspan="2" groups="purchase.group_analytic_accounting" domain="[('parent_id','!=',False)]" />
436                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
437                             </group>
438                         </group>
439                         <notebook>
440                         <page string="Notes">
441                             <field name="name"/>
442                         </page><page string="Invoices and Receptions">
443                             <field name="invoice_lines"/>
444                             <field name="move_ids"/>
445                         </page>
446                         </notebook>
447                     </sheet>
448                 </form>
449             </field>
450         </record>
451
452         <record id="purchase_order_line_tree" model="ir.ui.view">
453             <field name="name">purchase.order.line.tree</field>
454             <field name="model">purchase.order.line</field>
455             <field name="arch" type="xml">
456                 <tree string="Purchase Order Lines" create="false">
457                     <field name="order_id"/>
458                     <field name="name"/>
459                     <field name="partner_id" string="Supplier" />
460                     <field name="product_id"/>
461                     <field name="price_unit"/>
462                     <field name="product_qty"/>
463                     <field name="product_uom" groups="product.group_uom"/>
464                     <field name="price_subtotal"/>
465                     <field name="date_planned"  widget="date" width="135"/>
466                     <field name="state" invisible="1"/>
467                     <field name="invoiced" invisible="1"/>
468                 </tree>
469             </field>
470         </record>
471         <record id="purchase_order_line_form2" model="ir.ui.view">
472             <field name="name">purchase.order.line.form2</field>
473             <field name="model">purchase.order.line</field>
474             <field name="priority" eval="20"/>
475             <field name="arch" type="xml">
476                 <form string="Purchase Order Line" version="7.0" create="false">
477                     <sheet>
478                         <label for="order_id" class="oe_edit_only"/>
479                         <h1>
480                             <field name="order_id" class="oe_inline" domain="[('invoice_method','=','manual')]" />
481                             <label string="," attrs="{'invisible':[('date_order','=',False)]}"/>
482                             <field name="date_order" class="oe_inline"/>
483                         </h1>
484                         <label for="partner_id" class="oe_edit_only"/>
485                         <h2><field name="partner_id"/></h2>
486                         <group>
487                             <group>
488                                 <field name="product_id" readonly="1"/>
489                                 <label for="product_qty"/>
490                                 <div>
491                                     <field name="product_qty" readonly="1" class="oe_inline"/>
492                                     <field name="product_uom" readonly="1" groups="product.group_uom" class="oe_inline"/>
493                                 </div>
494                                 <field name="price_unit"/>
495                             </group>
496                             <group>
497                                 <field name="taxes_id" widget="many2many_tags"
498                                     domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
499                                 <field name="date_planned" widget="date" readonly="1"/>
500                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
501                                 <field name="account_analytic_id" colspan="4" groups="purchase.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
502                                 <field name="invoiced"/>
503                             </group>
504                         </group>
505                         <field name="name"/>
506                         <separator string="Manual Invoices"/>
507                         <field name="invoice_lines"/>
508                         <separator string="Stock Moves"/>
509                         <field name="move_ids"/>
510                     </sheet>
511                 </form>
512             </field>
513         </record>
514           <record id="purchase_order_line_search" model="ir.ui.view">
515             <field name="name">purchase.order.line.search</field>
516             <field name="model">purchase.order.line</field>
517             <field name="arch" type="xml">
518                 <search string="Search Purchase Order">
519                     <field name="order_id"/>
520                     <field name="product_id"/>
521                     <field name="partner_id" string="Supplier"/>
522                     <group expand="0" string="Group By...">
523                         <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by' : 'partner_id'}" />
524                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by' : 'product_id'}" />
525                         <filter icon="terp-gtk-jump-to-rtl" string="Order Reference" domain="[]" context="{'group_by' :'order_id'}"/>
526                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by' : 'state'}" />
527                     </group>
528                 </search>
529             </field>
530         </record>
531
532         <act_window
533             context="{'search_default_product_id': [active_id], 'default_product_id': active_id}"
534             id="action_purchase_line_product_tree"
535             name="Purchases"
536             res_model="purchase.order.line"
537             src_model="product.product"
538             groups="purchase.group_purchase_user"/>
539
540
541         <record id="purchase_line_form_action2" model="ir.actions.act_window">
542             <field name="name">On Purchase Order Lines</field>
543             <field name="type">ir.actions.act_window</field>
544             <field name="res_model">purchase.order.line</field>
545             <field name="domain">[('order_id.invoice_method','&lt;&gt;','picking'), ('state','in',('confirmed','done')), ('invoiced', '=', False)]</field>
546             <field name="view_type">form</field>
547             <field name="view_mode">tree,form</field>
548             <field name="search_view_id" ref="purchase_order_line_search"/>
549             <field name="help" type="html">
550               <p>
551                 Here you can track all the lines of purchase orders where the
552                 invoicing is "Based on Purchase Order Lines", and for which you
553                 have not received a supplier invoice yet. You can generate a
554                 draft supplier invoice based on the lines from this list.
555               </p>
556             </field>
557         </record>
558         <record id="purchase_line_form_action_tree2" model="ir.actions.act_window.view">
559             <field eval="1" name="sequence"/>
560             <field name="view_mode">tree</field>
561             <field name="view_id" ref="purchase_order_line_tree"/>
562             <field name="act_window_id" ref="purchase_line_form_action2"/>
563         </record>
564         <record id="purchase_line_form_action_form2" model="ir.actions.act_window.view">
565             <field eval="2" name="sequence"/>
566             <field name="view_mode">form</field>
567             <field name="view_id" ref="purchase_order_line_form2"/>
568             <field name="act_window_id" ref="purchase_line_form_action2"/>
569         </record>
570         <menuitem
571             action="purchase_line_form_action2"
572             id="menu_purchase_line_order_draft"
573             parent="menu_procurement_management_invoice"
574             sequence="72"/>
575
576         <!-- Procurements -->
577
578         <record id="view_procurement_form_inherit" model="ir.ui.view">
579             <field name="name">procurement.order.form.inherit</field>
580             <field name="model">procurement.order</field>
581             <field name="inherit_id" ref="procurement.procurement_form_view"/>
582             <field name="arch" type="xml">
583                 <xpath expr="//field[@name='close_move']" position="before">
584                     <field name="purchase_id"/>
585                 </xpath>
586             </field>
587         </record>
588         
589         <!-- Product Suppliers-->
590         
591         <record id="view_product_supplier_inherit" model="ir.ui.view">
592             <field name="name">product.normal.supplier.form.inherit</field>
593             <field name="model">product.product</field>
594             <field name="inherit_id" ref="product.product_normal_form_view"/>
595             <field name="arch" type="xml">
596                 <div name="options" position="inside">
597                     <field name="purchase_ok"/>
598                     <label for="purchase_ok"/>
599                 </div>
600                 <group name="procurement" position="after">
601                      <separator string="Suppliers"/>
602                      <field name="seller_ids" context="{'uom_id': uom_id}"/>
603                 </group>
604             </field>
605         </record>
606
607         <record id="product_product_normal_form_procurement_help_view" model="ir.ui.view">
608             <field name="name">product.normal.form.procurement.help.inherit</field>
609             <field name="model">product.product</field>
610             <field name="inherit_id" ref="procurement.product_form_view_procurement_button"/>
611             <field name="arch" type="xml">
612                 <group name="procurement_help" position="inside">
613                     <p attrs="{'invisible': ['|','|',('type','&lt;&gt;','service'),('procure_method','&lt;&gt;','make_to_order'),('supply_method','&lt;&gt;','buy')]}">
614                         When you sell this service to a customer, <b>a draft purchase order</b>
615                         will be created in order to subcontract the job 
616                         <i attrs="{'invisible': [('seller_id','=',False)]}">to 
617                         <field name="seller_id" class="oe_inline"/></i>.
618                     </p>
619                     <p attrs="{'invisible': ['|','|',('type','=','service'),('procure_method','&lt;&gt;','make_to_order'),('supply_method','&lt;&gt;','buy')]}">
620                         When you sell this product, OpenERP will trigger <b>a draft
621                         purchase order</b> to buy the required quantities to the supplier.
622                         The delivery order will be ready after having received the
623                         products.
624                     </p>
625                 </group>
626             </field>
627         </record>
628
629         <record id="product_search_form_view_purchase" model="ir.ui.view">
630             <field name="name">product.search.purchase.form</field>
631             <field name="model">product.product</field>
632             <field name="inherit_id" ref="product.product_search_form_view"/>
633             <field name="arch" type="xml">
634                 <filter name="filter_to_sell" position="before">
635                     <filter name="filter_to_purchase" string="To Purchase" icon="terp-accessories-archiver+" domain="[('purchase_ok', '=', 1)]"/>
636                 </filter>
637                 <filter name="filter_to_sell" position="after">
638                    <filter name="filter_to_purchase" string="Can be Purchased" icon="terp-accessories-archiver+" domain="[('purchase_ok', '=', 1)]"/>
639                 </filter>
640             </field>
641         </record>
642
643         <record id="view_template_purchase_ok_form" model="ir.ui.view">
644             <field name="name">product.template.purchase.ok.form.inherit</field>
645             <field name="model">product.template</field>
646             <field name="inherit_id" ref="product.product_template_form_view"/>
647             <field name="arch" type="xml">
648                 <field name="sale_ok" position="after">
649                     <field name="purchase_ok"/>
650                 </field>
651             </field>
652         </record>
653   
654         <record id="view_product_account_purchase_ok_form" model="ir.ui.view">
655             <field name="name">product.account.purchase.ok.form.inherit</field>
656             <field name="model">product.product</field>
657             <field name="inherit_id" ref="account.product_normal_form_view"/>
658             <field name="arch" type="xml">
659                 <xpath expr="//field[@name='property_account_expense']" position="replace" >
660                      <field name="property_account_expense" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" groups="account.group_account_user"/>
661                 </xpath>
662                 <xpath expr="//field[@name='supplier_taxes_id']" position="replace" >
663                      <field name="supplier_taxes_id" colspan="2" widget="many2many_tags" attrs="{'readonly':[('purchase_ok','=',0)]}"/>
664                 </xpath>
665             </field>
666         </record>
667
668     </data>
669 </openerp>