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