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