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