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