Launchpad automatic translations update.
[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         <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="Receive 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">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_check_and_set_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">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_check_and_set_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 RFQ" type="object" context="{'send_rfq':True}" class="oe_highlight"/>
202                     <button name="purchase_confirm" states="draft" string="Confirm Order"/>
203                     <button name="purchase_confirm" states="sent" string="Confirm Order" class="oe_highlight"/>
204                     <button name="wkf_send_rfq" states="confirmed" string="Resend Purchase Order" type="object" class="oe_highlight"/>
205                     <button name="action_cancel" states="except_picking,except_invoice" string="Cancel" type="object" />
206                     <button name="picking_ok" states="except_picking" string="Manually Corrected"/>
207                     <button name="invoice_ok" states="except_invoice" string="Manually Corrected"/>
208                     <button name="purchase_approve" states="confirmed" string="Approve Order" class="oe_highlight" groups="purchase.group_purchase_manager"/>
209                     <button name="view_invoice" string="Receive Invoice" type="object" attrs="{'invisible': ['|', ('invoice_method','=','picking'), '|', ('state','!=', 'approved'), ('invoiced','=',True) ]}" class="oe_highlight"/>
210                     <button name="view_picking" string="Receive Products" type="object" attrs="{'invisible': ['|', ('shipped','=',True), ('state','!=', 'approved')]}" class="oe_highlight"/>
211                     <button name="action_cancel_draft" states="cancel,sent,confirmed" string="Set to Draft" type="object" />
212                     <button name="purchase_cancel" states="draft,confirmed,sent" string="Cancel"/>
213                     <field name="state" widget="statusbar" statusbar_visible="draft,sent,approved,done" statusbar_colors='{"except_picking":"red","except_invoice":"red","confirmed":"blue"}' readonly="1"/>
214                 </header>
215                 <sheet>
216                     <div class="oe_title">
217                         <h1>
218                             <label string="Quotation " attrs="{'invisible': [('state','not in',('draft','sent'))]}"/>
219                             <label string="Purchase Order " attrs="{'invisible': [('state','in',('draft','sent'))]}"/>
220                             <field name="name" class="oe_inline" readonly="1"/>
221                         </h1>
222                     </div>
223                     <group>
224                         <group>
225                             <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)]"/>
226                             <field name="partner_ref"/>
227                             <field domain="[('type','=','purchase')]" name="pricelist_id" groups="product.group_purchase_pricelist" on_change="onchange_pricelist(pricelist_id, context)"/>
228                             <field name="currency_id" invisible='1'/>
229                         </group>
230                         <group>
231                             <field name="date_order"/>
232                             <field name="origin" attr="{'invisible': [('origin','=',False)]}"/>
233                             <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection" groups="stock.group_locations"/>
234                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
235                         </group>
236                     </group>
237                     <notebook>
238                         <page string="Purchase Order">
239                             <field name="order_line">
240                                 <tree string="Purchase Order Lines" editable="bottom">
241                                     <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)"/>
242                                     <field name="name"/>
243                                     <field name="date_planned"/>
244                                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
245                                     <field name="account_analytic_id" groups="purchase.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
246                                     <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)"/>
247                                     <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)"/>
248                                     <field name="price_unit"/>
249                                     <field name="taxes_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
250                                     <field name="price_subtotal"/>
251                                 </tree>
252                             </field>
253                             <group class="oe_subtotal_footer oe_right">
254                                 <field name="amount_untaxed" widget="monetary" options="{'currency_field': 'currency_id'}"/>
255                                 <field name="amount_tax" widget="monetary" options="{'currency_field': 'currency_id'}"/>
256                                 <div class="oe_subtotal_footer_separator oe_inline">
257                                     <label for="amount_total"/>
258                                     <button name="button_dummy"
259                                         states="draft" string="(update)" type="object" class="oe_edit_only oe_link"/>
260                                 </div>
261                                 <field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>
262                             </group>
263                             <div class="oe_clear"/>
264                             <label for="notes"/>
265                             <field name="notes"/>
266                         </page>
267                         <page string="Reception &amp; Invoicing">
268                             <group>
269                                 <group>
270                                     <field name="dest_address_id" string="Customer Address" on_change="onchange_dest_address_id(dest_address_id)"/>
271                                     <field name="minimum_planned_date"/>
272                                     <field name="location_id" groups="stock.group_locations"/>
273                                     <field name="shipped" groups="base.group_no_one"/>
274                                 </group>
275                                 <group>
276                                     <field name="invoice_method"/>
277                                     <field name="invoiced"/>
278                                     <field name="fiscal_position"/>
279                                     <!-- We do not need these fields anymore, the information is in open chatter -->
280                                     <field name="validator" groups="base.group_no_one"/>
281                                     <field name="date_approve" groups="base.group_no_one"/>
282                                 </group>
283                             </group>
284                             <separator string="Invoices"/>
285                             <field name="invoice_ids" context="{'type':'in_invoice', 'journal_type':'purchase'}"/>
286                         </page>
287                     </notebook>
288                 </sheet>
289                 <div class="oe_chatter">
290                     <field name="message_ids" widget="mail_thread"/>
291                     <field name="message_follower_ids" widget="mail_followers"/>
292                 </div>
293                 </form>
294             </field>
295         </record>
296
297        <record id="view_request_for_quotation_filter" model="ir.ui.view">
298             <field name="name">request.quotation.select</field>
299             <field name="model">purchase.order</field>
300             <field name="arch" type="xml">
301                 <search string="Search Purchase Order">
302                     <field name="name" string="Reference"/>
303                     <filter icon="terp-document-new" name="draft" string="Quotations" domain="[('state','=','draft')]" help="Purchase order which are in draft state"/>
304                     <filter icon="terp-check" name="approved" string="Approved" domain="[('state','in',('approved','done'))]" help="Approved purchase order"/>
305                     <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"/>
306                     <separator/>
307                     <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."/>
308                     <field name="partner_id"/>
309                     <field name="product_id"/>
310                     <field name="create_uid"/>
311                     <group expand="0" string="Group By...">
312                         <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
313                         <filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
314                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
315                         <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
316                         <filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'minimum_planned_date'}"/>
317                     </group>
318                 </search>
319             </field>
320         </record>
321
322         <record id="view_purchase_order_filter" model="ir.ui.view">
323             <field name="name">purchase.order.list.select</field>
324             <field name="model">purchase.order</field>
325             <field name="arch" type="xml">
326                 <search string="Search Purchase Order">
327                     <field name="name" string="Reference"/>
328                     <filter icon="terp-mail-message-new" string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
329                     <separator/>
330                     <filter icon="terp-document-new" name="draft" string="Quotations" domain="[('state','=','draft')]" help="Purchase orders which are in draft state"/>
331                     <filter icon="terp-check" name="approved" string="Purchase Orders" domain="[('state','not in',('draft','cancel'))]" help="Approved purchase orders"/>
332                     <filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" help="Purchase orders which are in exception state"/>
333                     <separator/>
334                     <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."/>
335                     <field name="partner_id"/>
336                     <field name="product_id"/>
337                     <field name="create_uid"/>
338                     <group expand="0" string="Group By...">
339                         <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
340                         <filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
341                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
342                         <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
343                         <filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'minimum_planned_date'}"/>
344                     </group>
345                 </search>
346             </field>
347         </record>
348
349         <record id="purchase_order_tree" model="ir.ui.view">
350             <field name="name">purchase.order.tree</field>
351             <field name="model">purchase.order</field>
352             <field name="arch" type="xml">
353                 <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">
354                     <field name="message_unread" invisible="1"/>
355                     <field name="name" string="Reference"/>
356                     <field name="date_order" />
357                     <field name="partner_id"/>
358                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
359                     <field name="minimum_planned_date" invisible="context.get('quotation_only', False)"/>
360                     <field name="origin"/>
361                     <field name="amount_untaxed" sum="Total Untaxed amount"/>
362                     <field name="amount_total" sum="Total amount"/>
363                     <field name="state"/>
364                 </tree>
365             </field>
366         </record>
367
368         <record id="purchase_rfq" model="ir.actions.act_window">
369             <field name="name">Quotations</field>
370             <field name="type">ir.actions.act_window</field>
371             <field name="res_model">purchase.order</field>
372             <field name="context">{'search_default_draft': 1, 'search_default_to_approve': 1}</field>
373             <field name="domain">[('state','in',('draft','sent','confirmed'))]</field>
374             <field name="view_mode">tree,form,graph,calendar</field>
375             <field name="search_view_id" ref="view_purchase_order_filter"/>
376             <field name="help" type="html">
377               <p class="oe_view_nocontent_create">
378                 Click to create a request for quotation.
379               </p><p>
380                 The quotation contains the history of the discussion/negociation
381                 you had with your supplier. Once confirmed, a request for
382                 quotation is converted into a purchase order.
383               </p><p>
384                 Most propositions of purchase orders are created automatically
385                 by OpenERP based on inventory needs.
386               </p>
387             </field>
388         </record>
389         <menuitem action="purchase_rfq" id="menu_purchase_rfq"
390             parent="menu_procurement_management"
391             sequence="0"/>
392
393         <record id="purchase_form_action" model="ir.actions.act_window">
394             <field name="name">Purchase Orders</field>
395             <field name="type">ir.actions.act_window</field>
396             <field name="res_model">purchase.order</field>
397             <field name="view_mode">tree,form,graph,calendar</field>
398             <field name="context">{}</field>
399             <field name="domain">[('state','not in',('draft','sent','confirmed'))]</field>
400             <field name="search_view_id" ref="view_purchase_order_filter"/>
401             <field name="help" type="html">
402               <p class="oe_view_nocontent_create">
403                 Click to create a quotation that will be converted into a purchase order. 
404               </p><p>
405                 Use this menu to search within your purchase orders by
406                 references, supplier, products, etc. For each purchase order,
407                 you can track the related discussion with the supplier, control
408                 the products received and control the supplier invoices.
409               </p>
410             </field>
411         </record>
412         <menuitem action="purchase_form_action" id="menu_purchase_form_action" parent="menu_procurement_management" sequence="6"/>
413
414         <record id="purchase_order_line_form" model="ir.ui.view">
415             <field name="name">purchase.order.line.form</field>
416             <field name="model">purchase.order.line</field>
417             <field name="arch" type="xml">
418                 <form string="Purchase Order Line" version="7.0">
419                     <sheet>
420                         <group>
421                             <group>
422                                 <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)"/>
423                                 <label for="product_qty"/>
424                                 <div>
425                                     <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"/>
426                                     <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"/>
427                                 </div>
428                                 <field name="price_unit"/>
429                             </group>
430                             <group>
431                                 <field name="taxes_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
432                                 <field name="date_planned" widget="date"/>
433                                 <field name="account_analytic_id" colspan="2" groups="purchase.group_analytic_accounting" domain="[('parent_id','!=',False)]" />
434                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
435                             </group>
436                         </group>
437                         <notebook>
438                         <page string="Notes">
439                             <field name="name"/>
440                         </page><page string="Invoices and Receptions">
441                             <field name="invoice_lines"/>
442                             <field name="move_ids"/>
443                         </page>
444                         </notebook>
445                     </sheet>
446                 </form>
447             </field>
448         </record>
449
450         <record id="purchase_order_line_tree" model="ir.ui.view">
451             <field name="name">purchase.order.line.tree</field>
452             <field name="model">purchase.order.line</field>
453             <field name="arch" type="xml">
454                 <tree string="Purchase Order Lines">
455                     <field name="order_id"/>
456                     <field name="name"/>
457                     <field name="partner_id" string="Supplier" />
458                     <field name="product_id"/>
459                     <field name="price_unit"/>
460                     <field name="product_qty"/>
461                     <field name="product_uom" groups="product.group_uom"/>
462                     <field name="price_subtotal"/>
463                     <field name="date_planned"  widget="date" width="135"/>
464                     <field name="state" invisible="1"/>
465                     <field name="invoiced" invisible="1"/>
466                 </tree>
467             </field>
468         </record>
469         <record id="purchase_order_line_form2" model="ir.ui.view">
470             <field name="name">purchase.order.line.form2</field>
471             <field name="model">purchase.order.line</field>
472             <field name="priority" eval="20"/>
473             <field name="arch" type="xml">
474                 <form string="Purchase Order Line" version="7.0">
475                     <sheet>
476                         <label for="order_id" class="oe_edit_only"/>
477                         <h1>
478                             <field name="order_id" class="oe_inline"/>
479                             <label string="," attrs="{'invisible':[('date_order','=',False)]}"/>
480                             <field name="date_order" class="oe_inline"/>
481                         </h1>
482                         <label for="partner_id" class="oe_edit_only"/>
483                         <h2><field name="partner_id"/></h2>
484                         <group>
485                             <group>
486                                 <field name="product_id" readonly="1"/>
487                                 <label for="product_qty"/>
488                                 <div>
489                                     <field name="product_qty" readonly="1" class="oe_inline"/>
490                                     <field name="product_uom" readonly="1" groups="product.group_uom" class="oe_inline"/>
491                                 </div>
492                                 <field name="price_unit"/>
493                             </group>
494                             <group>
495                                 <field name="taxes_id" widget="many2many_tags"
496                                     domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
497                                 <field name="date_planned" widget="date" readonly="1"/>
498                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
499                                 <field name="account_analytic_id" colspan="4" groups="purchase.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
500                                 <field name="invoiced"/>
501                             </group>
502                         </group>
503                         <field name="name"/>
504                         <separator string="Manual Invoices"/>
505                         <field name="invoice_lines"/>
506                         <separator string="Stock Moves"/>
507                         <field name="move_ids"/>
508                     </sheet>
509                 </form>
510             </field>
511         </record>
512           <record id="purchase_order_line_search" model="ir.ui.view">
513             <field name="name">purchase.order.line.search</field>
514             <field name="model">purchase.order.line</field>
515             <field name="arch" type="xml">
516                 <search string="Search Purchase Order">
517                     <field name="order_id"/>
518                     <field name="product_id"/>
519                     <field name="partner_id" string="Supplier"/>
520                     <group expand="0" string="Group By...">
521                         <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by' : 'partner_id'}" />
522                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by' : 'product_id'}" />
523                         <filter icon="terp-gtk-jump-to-rtl" string="Order Reference" domain="[]" context="{'group_by' :'order_id'}"/>
524                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by' : 'state'}" />
525                     </group>
526                 </search>
527             </field>
528         </record>
529
530         <act_window
531             context="{'search_default_product_id': [active_id], 'default_product_id': active_id}"
532             id="action_purchase_line_product_tree"
533             name="Purchases"
534             res_model="purchase.order.line"
535             src_model="product.product"
536             groups="purchase.group_purchase_user"/>
537
538
539         <record id="purchase_line_form_action2" model="ir.actions.act_window">
540             <field name="name">On Purchase Order Lines</field>
541             <field name="type">ir.actions.act_window</field>
542             <field name="res_model">purchase.order.line</field>
543             <field name="domain">[('order_id.invoice_method','&lt;&gt;','picking'), ('state','in',('confirmed','done')), ('invoiced', '=', False)]</field>
544             <field name="view_type">form</field>
545             <field name="view_mode">tree,form</field>
546             <field name="search_view_id" ref="purchase_order_line_search"/>
547             <field name="help" type="html">
548               <p>
549                 Here you can track all the lines of purchase orders where the
550                 invoicing is "Based on Purchase Order Lines", and for which you
551                 have not received a supplier invoice yet. You can generate a
552                 draft supplier invoice based on the lines from this list.
553               </p>
554             </field>
555         </record>
556         <record id="purchase_line_form_action_tree2" model="ir.actions.act_window.view">
557             <field eval="1" name="sequence"/>
558             <field name="view_mode">tree</field>
559             <field name="view_id" ref="purchase_order_line_tree"/>
560             <field name="act_window_id" ref="purchase_line_form_action2"/>
561         </record>
562         <record id="purchase_line_form_action_form2" model="ir.actions.act_window.view">
563             <field eval="2" name="sequence"/>
564             <field name="view_mode">form</field>
565             <field name="view_id" ref="purchase_order_line_form2"/>
566             <field name="act_window_id" ref="purchase_line_form_action2"/>
567         </record>
568         <menuitem
569             action="purchase_line_form_action2"
570             id="menu_purchase_line_order_draft"
571             parent="menu_procurement_management_invoice"
572             sequence="72"/>
573
574         <!-- Procurements -->
575
576         <record id="view_procurement_form_inherit" model="ir.ui.view">
577             <field name="name">procurement.order.form.inherit</field>
578             <field name="model">procurement.order</field>
579             <field name="inherit_id" ref="procurement.procurement_form_view"/>
580             <field name="arch" type="xml">
581                 <xpath expr="//field[@name='close_move']" position="before">
582                     <field name="purchase_id"/>
583                 </xpath>
584             </field>
585         </record>
586         
587         <!-- Product Suppliers-->
588         
589         <record id="view_product_supplier_inherit" model="ir.ui.view">
590             <field name="name">product.normal.supplier.form.inherit</field>
591             <field name="model">product.product</field>
592             <field name="inherit_id" ref="product.product_normal_form_view"/>
593             <field name="arch" type="xml">
594                 <div name="options" position="inside">
595                     <field name="purchase_ok"/>
596                     <label for="purchase_ok"/>
597                 </div>
598                 <group name="procurement" position="after">
599                      <separator string="Suppliers"/>
600                      <field name="seller_ids" context="{'uom_id': uom_id}"/>
601                 </group>
602             </field>
603         </record>
604
605         <record id="product_product_normal_form_procurement_help_view" model="ir.ui.view">
606             <field name="name">product.normal.form.procurement.help.inherit</field>
607             <field name="model">product.product</field>
608             <field name="inherit_id" ref="procurement.product_form_view_procurement_button"/>
609             <field name="arch" type="xml">
610                 <group name="procurement_help" position="inside">
611                     <p attrs="{'invisible': ['|','|',('type','&lt;&gt;','service'),('procure_method','&lt;&gt;','make_to_order'),('supply_method','&lt;&gt;','buy')]}">
612                         When you sell this service to a customer, <b>a draft purchase order</b>
613                         will be created in order to subcontract the job 
614                         <i attrs="{'invisible': [('seller_id','=',False)]}">to 
615                         <field name="seller_id" class="oe_inline"/></i>.
616                     </p>
617                     <p attrs="{'invisible': ['|','|',('type','=','service'),('procure_method','&lt;&gt;','make_to_order'),('supply_method','&lt;&gt;','buy')]}">
618                         When you sell this product, OpenERP will trigger <b>a draft
619                         purchase order</b> to buy the required quantities to the supplier.
620                         The delivery order will be ready after having received the
621                         products.
622                     </p>
623                 </group>
624             </field>
625         </record>
626
627         <record id="product_search_form_view_purchase" model="ir.ui.view">
628             <field name="name">product.search.purchase.form</field>
629             <field name="model">product.product</field>
630             <field name="inherit_id" ref="product.product_search_form_view"/>
631             <field name="arch" type="xml">
632                 <filter name="filter_to_sell" position="before">
633                     <filter name="filter_to_purchase" string="To Purchase" icon="terp-accessories-archiver+" domain="[('purchase_ok', '=', 1)]"/>
634                 </filter>
635                 <filter name="filter_to_sell" position="after">
636                    <filter name="filter_to_purchase" string="Can be Purchased" icon="terp-accessories-archiver+" domain="[('purchase_ok', '=', 1)]"/>
637                 </filter>
638             </field>
639         </record>
640
641         <record id="view_template_purchase_ok_form" model="ir.ui.view">
642             <field name="name">product.template.purchase.ok.form.inherit</field>
643             <field name="model">product.template</field>
644             <field name="inherit_id" ref="product.product_template_form_view"/>
645             <field name="arch" type="xml">
646                 <field name="sale_ok" position="after">
647                     <field name="purchase_ok"/>
648                 </field>
649             </field>
650         </record>
651   
652         <record id="view_product_account_purchase_ok_form" model="ir.ui.view">
653             <field name="name">product.account.purchase.ok.form.inherit</field>
654             <field name="model">product.product</field>
655             <field name="inherit_id" ref="account.product_normal_form_view"/>
656             <field name="arch" type="xml">
657                 <xpath expr="//field[@name='property_account_expense']" position="replace" >
658                      <field name="property_account_expense" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" />
659                 </xpath>
660                 <xpath expr="//field[@name='supplier_taxes_id']" position="replace" >
661                      <field name="supplier_taxes_id" colspan="2" widget="many2many_tags" attrs="{'readonly':[('purchase_ok','=',0)]}"/>
662                 </xpath>
663             </field>
664         </record>
665
666     </data>
667 </openerp>