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