[IMP] access rights
[odoo/odoo.git] / addons / purchase / purchase_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4        <menuitem icon="terp-purchase" id="base.menu_purchase_root" name="Purchases" sequence="3"
5            groups="group_purchase_manager,group_purchase_user"
6            web_icon="images/purchases.png"
7            web_icon_hover="images/purchases-hover.png"/>
8        <menuitem id="menu_procurement_management" name="Purchase Management"
9             parent="base.menu_purchase_root" sequence="1" />
10
11         <menuitem id="menu_purchase_config_purchase" name="Configuration"
12             parent="base.menu_purchase_root" sequence="100"/>
13
14         <menuitem
15             action="product.product_pricelist_action" id="menu_product_pricelist_action_purhase"
16             parent="menu_purchase_config_purchase" sequence="2"/>
17
18         <menuitem
19             action="product.product_pricelist_action2" id="menu_product_pricelist_action2_purchase"
20             parent="menu_purchase_config_purchase" sequence="1"/>
21
22
23         <!--supplier addresses action-->
24         <record id="action_supplier_address_form" model="ir.actions.act_window">
25             <field name="name">Addresses</field>
26             <field name="type">ir.actions.act_window</field>
27             <field name="res_model">res.partner.address</field>
28             <field name="view_type">form</field>
29             <field name="context">{"search_default_supplier":1}</field>
30             <field name="search_view_id" ref="base.view_res_partner_address_filter"/>
31             <field name="help">Access your supplier records and maintain a good relationship with your suppliers. You can track all your interactions with them through the History tab: emails, orders, meetings, etc.</field>
32         </record>
33         <record id="action_supplier_address_form_view1" model="ir.actions.act_window.view">
34             <field eval="10" name="sequence"/>
35             <field name="view_mode">tree</field>
36             <field name="view_id" ref="base.view_partner_address_tree"/>
37             <field name="act_window_id" ref="action_supplier_address_form"/>
38         </record>
39         <record id="action_supplier_address_form_view2" model="ir.actions.act_window.view">
40             <field eval="20" name="sequence"/>
41             <field name="view_mode">form</field>
42             <field name="view_id" ref="base.view_partner_address_form1"/>
43             <field name="act_window_id" ref="action_supplier_address_form"/>
44         </record>
45
46      <!--supplier menu-->
47       <menuitem id="base.menu_procurement_management_supplier" name="Address Book"
48             parent="base.menu_purchase_root" sequence="3"/>
49       <menuitem id="base.menu_procurement_management_supplier_name" name="Suppliers"
50             parent="base.menu_procurement_management_supplier"
51             action="base.action_partner_supplier_form" sequence="1"/>
52
53           <!--Inventory control-->
54       <menuitem id="menu_procurement_management_inventory" name="Receive Products"
55             parent="base.menu_purchase_root" sequence="4"/>
56       <menuitem action="stock.action_picking_tree4" id="menu_action_picking_tree4" parent="menu_procurement_management_inventory"
57             name="Incoming Shipments" sequence="9"
58             groups="base.group_extended"/>
59       <menuitem action="stock.action_reception_picking_move" id="menu_action_picking_tree_in_move"
60             parent="menu_procurement_management_inventory" sequence="11"/>
61
62      <!--Invoice control-->
63      <menuitem id="menu_procurement_management_invoice" name="Invoice Control"
64           parent="base.menu_purchase_root" sequence="6"/>
65
66     <record id="action_invoice_pending" model="ir.actions.act_window">
67         <field name="res_model">account.invoice</field>
68         <field name="view_type">form</field>
69         <field name="view_mode">tree,form,calendar,graph</field>
70         <field eval="False" name="view_id"/>
71         <field name="domain">[('type','=','in_invoice')]</field>
72         <field name="context">{'type':'in_invoice', 'journal_type': 'purchase', 'search_default_draft': 1}</field>
73         <field name="search_view_id" ref="account.view_account_invoice_filter"/>
74             <field name="help">Use this menu to control the invoices to be received from your supplier. OpenERP pregenerates draft invoices from your purchase orders or receptions, according to your settings. Once you receive a supplier invoice, you can match it with the draft invoice and validate it.</field>
75     </record>
76
77      <menuitem name="Supplier Invoices to Receive"
78           id="menu_procurement_management_pending_invoice"
79           action="action_invoice_pending"
80           parent="menu_procurement_management_invoice"
81           sequence="13"/>
82
83       <!--product menu-->
84       <menuitem id="menu_procurement_management_product" name="Products"
85           parent="base.menu_purchase_root" sequence="8"/>
86       <menuitem name="Products" id="menu_procurement_partner_contact_form" action="product.product_normal_action_puchased"
87           parent="menu_procurement_management_product"/>
88
89        <record model="ir.ui.view" id="purchase_order_calendar">
90             <field name="name">purchase.order.calendar</field>
91             <field name="model">purchase.order</field>
92             <field name="type">calendar</field>
93             <field name="priority" eval="2"/>
94             <field name="arch" type="xml">
95                 <calendar string="Calendar View" date_start="minimum_planned_date" color="partner_id">
96                     <field name="name"/>
97                     <field name="amount_total"/>
98                     <field name="partner_id"/>
99                 </calendar>
100             </field>
101         </record>
102         <record model="ir.ui.view" id="view_purchase_order_graph">
103             <field name="name">purchase.order.graph</field>
104             <field name="model">purchase.order</field>
105             <field name="type">graph</field>
106             <field name="arch" type="xml">
107                 <graph string="Purchase Order" type="bar">
108                     <field name="partner_id"/>
109                     <field name="amount_total" operator="+"/>
110                 </graph>
111             </field>
112         </record>
113
114         <record id="purchase_order_form" model="ir.ui.view">
115             <field name="name">purchase.order.form</field>
116             <field name="model">purchase.order</field>
117             <field name="type">form</field>
118             <field name="arch" type="xml">
119                 <form string="Purchase Order">
120                     <group col="6" colspan="4">
121                         <field name="name"/>
122                         <field name="date_order"/>
123                         <field name="invoiced"/>
124                         <newline/>
125                         <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection"/>
126                         <field name="partner_ref"/>
127                         <field name="shipped"/>
128                         <field name="company_id" groups="base.group_multi_company" widget="selection"/>
129                     </group>
130                     <notebook colspan="4">
131                         <page string="Purchase Order">
132                             <field name="partner_id" on_change="onchange_partner_id(partner_id)" context="{'search_default_supplier':1}" />
133                             <field name="partner_address_id"/>
134                             <field domain="[('type','=','purchase')]" name="pricelist_id" groups="base.group_extended"/>
135                             <field name="origin" groups="base.group_extended"/>
136                             <newline/>
137                             <field colspan="4" name="order_line" nolabel="1" mode="tree,form">
138                                 <tree string="Purchase Order Lines">
139                                     <field name="date_planned"/>
140                                     <field name="name"/>
141                                     <field name="product_qty"/>
142                                     <field name="product_uom"/>
143                                     <field name="price_unit"/>
144                                     <field name="price_subtotal"/>
145                                 </tree>
146                                 <!-- default form view -->
147                             </field>
148                             <group col="7" colspan="4">
149                                 <field name="amount_untaxed" sum="Untaxed amount"/>
150                                 <field name="amount_tax"/>
151                                 <field name="amount_total" sum="Total amount"/>
152                                 <button name="button_dummy" states="draft" string="Compute" type="object" icon="gtk-execute"/>
153                             </group>
154                             <group col="11" colspan="4">
155                                 <field name="state" readonly="1"/>
156                                 <button name="purchase_cancel" states="draft,confirmed,wait_auth" string="Cancel" icon="gtk-cancel"/>
157                                 <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="gtk-convert"/>
158                                 <button name="action_cancel" states="approved,except_picking,except_invoice" string="Cancel Purchase Order" type="object" icon="gtk-cancel"/>
159                                 <button name="picking_ok" states="except_picking" string="Manually Corrected" icon="gtk-convert"/>
160                                 <button name="invoice_ok" states="except_invoice" string="Manually Corrected" icon="gtk-convert"/>
161                                 <button name="purchase_confirm" states="draft" string="Convert to Purchase Order" icon="gtk-go-forward"/>
162                                 <button name="purchase_appbuyer" states="wait_auth" string="Approve Purchase" icon="gtk-ok"/>
163                                 <button name="purchase_approve" states="confirmed" string="Approved by Supplier" icon="gtk-go-forward"/>
164                                 <button name="%(report_purchase_order)d" string="Print" states="approved" type="action" icon="gtk-print"/>
165                             </group>
166                         </page>
167                         <page string="Delivery &amp; Invoicing" groups="base.group_extended">
168                             <group colspan="2" col="2">
169                                 <separator string="Delivery" colspan="2"/>
170                                 <field name="dest_address_id" on_change="onchange_dest_address_id(dest_address_id)"/>
171                                 <field name="minimum_planned_date"/>
172                                 <field name="location_id"/>
173                             </group>
174                             <group colspan="2" col="2">
175                                 <separator string="Invoice Control" colspan="2"/>
176                                 <field name="invoice_method"/>
177                                 <field name="fiscal_position" widget="selection"/>
178                             </group>
179                             <newline/>
180                             <separator string="Purchase Control" colspan="4"/>
181                             <field name="validator"/>
182                             <field name="date_approve"/>
183                                 <separator string="Invoices" colspan="4"/>
184                                 <newline/>
185                                 <field name="invoice_ids" groups="base.group_extended" nolabel="1" colspan="4"/>
186                         </page>
187                         <page string="Notes">
188                             <field colspan="4" name="notes" nolabel="1"/>
189                         </page>
190                     </notebook>
191                 </form>
192             </field>
193         </record>
194
195        <record id="view_purchase_order_filter" model="ir.ui.view">
196             <field name="name">purchase.order.list.select</field>
197             <field name="model">purchase.order</field>
198             <field name="type">search</field>
199             <field name="arch" type="xml">
200                 <search string="Search Purchase Order">
201                  <group col='10' colspan='4'>
202                     <filter icon="terp-document-new" name="draft" string="Quotations" domain="[('state','=','draft')]" separator="1" help="Purchase order which are in draft state"/>
203                     <filter icon="terp-camera_test" name="confirmed" string="To Approve" domain="[('state','in',('wait','confirmed'))]" separator="1" help="Purchase order to be approved"/>
204                     <filter icon="terp-check" name="approved" string="Approved" domain="[('state','in',('approved','done'))]" separator="1" help="Approved purchase order"/>
205                     <separator orientation="vertical"/>
206                     <filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" separator="1" help="Purchase order which are in the exception state"/>
207                     <separator orientation="vertical"/>
208                     <filter icon="terp-gtk-go-back-rtl" string="To be Invoiced" domain="[('invoiced','=',1)]" separator="1" help="Purchase order to be invoiced"/>
209                     <separator orientation="vertical"/>
210                     <field name="name" select="1" string="Reference"/>
211                     <field name="partner_id" select="1"/>
212                     <field name="product_id" select="1"/>
213                     <field name="create_uid" select="1"/>
214                 </group>
215                 <newline/>
216                   <group expand="0" string="Group By..." colspan="4" col="10" groups="base.group_extended">
217                     <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
218                      <separator orientation="vertical"/>
219                     <filter string="Origin" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
220                     <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
221                      <separator orientation="vertical"/>
222                     <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
223                     <filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'minimum_planned_date'}"/>
224
225                 </group>
226               </search>
227             </field>
228         </record>
229         <record id="purchase_order_tree" model="ir.ui.view">
230             <field name="name">purchase.order.tree</field>
231             <field name="model">purchase.order</field>
232             <field name="type">tree</field>
233             <field name="arch" type="xml">
234                 <tree colors="grey:state=='cancel';blue:state in ('wait','confirmed');red:state in ('except_invoice','except_picking')" string="Purchase Order">
235                     <field name="name" string="Reference"/>
236                     <field name="date_order" string="Order Date"/>
237                     <field name="partner_id"/>
238                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
239                     <field name="location_id"/>
240                     <field name="minimum_planned_date"/>
241                     <field name="origin"/>
242                     <field name="invoiced_rate" widget="progressbar"/>
243                     <field name="shipped_rate" widget="progressbar"/>
244                     <field name="amount_untaxed" sum="Total Untaxed amount"/>
245                     <field name="amount_total" sum="Total amount"/>
246                     <field name="state"/>
247                 </tree>
248             </field>
249         </record>
250
251         <record id="purchase_rfq" model="ir.actions.act_window">
252             <field name="name">Requests for Quotation</field>
253             <field name="type">ir.actions.act_window</field>
254             <field name="res_model">purchase.order</field>
255             <field name="view_type">form</field>
256             <field name="context">{'search_default_draft': 1}</field>
257             <field name="view_mode">tree,form,graph,calendar</field>
258             <field name="search_view_id" ref="view_purchase_order_filter"/>
259             <field name="help">With the Requests for Quotation menu you can create new requests for quotations, review existing ones or turn them into a purchase order once the supplier offer is approved. When you confirm a RfQ, OpenERP will convert it to a Purchase Order and generate the next steps: draft reception of the products, draft invoice to control.</field>
260         </record>
261         <menuitem action="purchase_rfq" id="menu_purchase_rfq" parent="menu_procurement_management"
262                 sequence="6"/>
263
264         <record id="purchase_form_action" model="ir.actions.act_window">
265             <field name="name">Purchase Orders</field>
266             <field name="type">ir.actions.act_window</field>
267             <field name="res_model">purchase.order</field>
268             <field name="view_mode">tree,form,graph,calendar</field>
269             <field name="context">{'search_default_approved': 1,'search_default_create_uid':uid}</field>
270             <field name="search_view_id" ref="view_purchase_order_filter"/>
271             <field name="help">From the Purchase Orders menu, you can track the status of your orders: products received, invoice received and controlled.
272 </field>
273         </record>
274         <menuitem action="purchase_form_action" id="menu_purchase_form_action" parent="menu_procurement_management" />
275
276
277         <record id="purchase_order_line_form" model="ir.ui.view">
278             <field name="name">purchase.order.line.form</field>
279             <field name="model">purchase.order.line</field>
280             <field name="type">form</field>
281             <field name="arch" type="xml">
282                 <form string="Purchase Order Line">
283                     <notebook colspan="4">
284                         <page string="Order Line">
285                             <field name="product_id" colspan="4" context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" on_change="product_id_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,notes)"/>
286                             <field name="product_qty" context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" on_change="product_id_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id,parent.date_order,parent.fiscal_position,date_planned,name,price_unit,notes)"/>
287                             <field name="product_uom" on_change="product_uom_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position)"/>
288                             <field colspan="4" name="name"/>
289                             <field name="date_planned" widget="date"/>
290                             <field name="price_unit"/>
291                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
292                             <field name="account_analytic_id" colspan="4" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]" />
293                             <group colspan="4" col="4" groups="base.group_extended">
294                                 <separator colspan="4" string="Taxes"/>
295                                 <field colspan="4" nolabel="1" name="taxes_id"
296                                     domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
297                             </group>
298                         </page>
299                         <page string="Invoicing" groups="base.group_extended">
300                             <separator colspan="4" string="Manual Invoices"/>
301                             <field name="invoiced"/>
302                             <newline/>
303                             <field colspan="4" name="invoice_lines" nolabel="1" widget="many2many"/>
304                         </page>
305                            <page string="Notes">
306                             <field colspan="4" name="notes" nolabel="1"/>
307                         </page>
308                         <page string="History" groups="base.group_extended">
309                                <separator colspan="4" string="Stock Moves"/>
310                                <field colspan="4" name="move_ids" nolabel="1" widget="many2many"/>
311                         </page>
312                     </notebook>
313                 </form>
314             </field>
315         </record>
316
317         <record id="purchase_order_line_tree" model="ir.ui.view">
318             <field name="name">purchase.order.line.tree</field>
319             <field name="model">purchase.order.line</field>
320             <field name="type">tree</field>
321             <field name="arch" type="xml">
322                 <tree string="Purchase Order Lines">
323                     <field name="order_id"/>
324                     <field name="name"/>
325                     <field name="partner_id" string="Supplier" />
326                     <field name="product_id"/>
327                     <field name="price_unit"/>
328                     <field name="product_qty"/>
329                     <field name="product_uom"/>
330                     <field name="price_subtotal"/>
331                     <field name="date_planned"  widget="date" width="135"/>
332
333
334
335                     <field name="state" invisible="1"/>
336                     <field name="invoiced" invisible="1"/>
337                 </tree>
338             </field>
339         </record>
340         <record id="purchase_order_line_form2" model="ir.ui.view">
341             <field name="name">purchase.order.line.form2</field>
342             <field name="model">purchase.order.line</field>
343             <field name="type">form</field>
344             <field name="priority" eval="20"/>
345             <field name="arch" type="xml">
346                 <form string="Purchase Order Line">
347                     <notebook colspan="4">
348                         <page string="Order Line">
349                                <separator colspan="4" string="General Information"/>
350                              <field name="order_id"/>
351                             <field name="product_id" readonly="1" />
352                             <field name="product_qty" readonly="1" />
353                             <field name="product_uom" readonly="1"/>
354                             <field colspan="4" name="name"/>
355                             <field name="date_planned" widget="date"  readonly="1"/>
356                             <field name="price_unit"/>
357                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
358                             <field name="account_analytic_id" colspan="4" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
359                             <group colspan="4" col="4" groups="base.group_extended">
360                                 <separator colspan="4" string="Taxes"/>
361                                 <field colspan="4" nolabel="1" name="taxes_id"
362                                     domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
363                             </group>
364                         </page>
365                         <page string="Invoicing" groups="base.group_extended">
366                             <separator colspan="4" string="Manual Invoices"/>
367                             <field name="invoiced"/>
368                             <newline/>
369                             <field colspan="4" name="invoice_lines" nolabel="1" widget="many2many"/>
370                         </page>
371                          <page string="Notes">
372                             <field colspan="4" name="notes" nolabel="1"/>
373                         </page>
374                         <page string="History" groups="base.group_extended">
375                                <separator colspan="4" string="Stock Moves"/>
376                                <field colspan="4" name="move_ids" nolabel="1" widget="many2many"/>
377                         </page>
378                     </notebook>
379                 </form>
380             </field>
381         </record>
382           <record id="purchase_order_line_search" model="ir.ui.view">
383             <field name="name">purchase.order.line.search</field>
384             <field name="model">purchase.order.line</field>
385             <field name="type">search</field>
386             <field name="arch" type="xml">
387                 <search string="Search Purchase Order">
388                         <group>
389                         <field name="order_id"/>
390                         <field name="product_id"/>
391                         <field name="partner_id"  string="Supplier"/>
392                         </group>
393                         <newline/>
394                         <group expand="0" string="Group By...">
395                         <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by' : 'partner_id'}" />
396                         <separator orientation="vertical"/>
397                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by' : 'product_id'}" />
398                         <filter icon="terp-gtk-jump-to-rtl" string="Order Reference" domain="[]" context="{'group_by' :'order_id'}"/>
399                         <separator orientation="vertical"/>
400                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by' : 'state'}" />
401                         </group>
402                </search>
403             </field>
404         </record>
405
406         <act_window
407             context="{'search_default_partner_id': [active_id]}"
408             id="act_res_partner_2_purchase_order"
409             name="Purchase Orders"
410             groups="purchase.group_purchase_user"
411             res_model="purchase.order"
412             src_model="res.partner"/>
413
414         <act_window
415             context="{'search_default_product_id': [active_id]}"
416             id="action_purchase_line_product_tree"
417             name="Purchases"
418             res_model="purchase.order.line"
419             src_model="product.product"
420             groups="purchase.group_purchase_user"/>
421
422
423         <record id="purchase_line_form_action2" model="ir.actions.act_window">
424             <field name="name">Purchase Lines Not Invoiced</field>
425             <field name="type">ir.actions.act_window</field>
426             <field name="res_model">purchase.order.line</field>
427             <field name="domain">[('state','in',('confirmed','done')), ('invoiced', '=', False)]</field>
428             <field name="view_type">form</field>
429             <field name="view_mode">tree,form</field>
430             <field name="search_view_id" ref="purchase_order_line_search"/>
431             <field name="help">If you set the invoicing control on a purchase order as "Manual", you can track here all the purchase order lines for which you have not received the supplier invoice yet. Once you are ready to receive a supplier invoice, you can generate a draft supplier invoice based on the lines from this menu.</field>
432         </record>
433         <record id="purchase_line_form_action_tree2" model="ir.actions.act_window.view">
434             <field eval="1" name="sequence"/>
435             <field name="view_mode">tree</field>
436             <field name="view_id" ref="purchase_order_line_tree"/>
437             <field name="act_window_id" ref="purchase_line_form_action2"/>
438         </record>
439         <record id="purchase_line_form_action_form2" model="ir.actions.act_window.view">
440             <field eval="2" name="sequence"/>
441             <field name="view_mode">form</field>
442             <field name="view_id" ref="purchase_order_line_form2"/>
443             <field name="act_window_id" ref="purchase_line_form_action2"/>
444         </record>
445         <menuitem
446             action="purchase_line_form_action2"
447             id="menu_purchase_line_order_draft"
448             groups="base.group_extended"
449             parent="menu_procurement_management_invoice"
450             sequence="72"/>
451
452         <!--
453             Procurements
454         -->
455
456         <record id="view_procurement_form_inherit" model="ir.ui.view">
457             <field name="name">procurement.order.form.inherit</field>
458             <field name="model">procurement.order</field>
459             <field name="inherit_id" ref="procurement.procurement_form_view"/>
460             <field name="type">form</field>
461             <field name="arch" type="xml">
462                 <xpath expr="/form/notebook/page/field[@name='close_move']" position="before">
463                     <field name="purchase_id"/>
464                 </xpath>
465             </field>
466         </record>
467
468     </data>
469 </openerp>