4b6f184ebe2f96028ae913106f11f3f999855597
[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="menu_purchase_root" name="Purchase Management"
5             groups="group_purchase_user"/>-->
6        <menuitem icon="terp-purchase" id="menu_purchase_root" name="Procurement Management"
7             groups="group_purchase_user"/>
8            <menuitem id="menu_procurement_management" name="Procurement Management"
9             parent="menu_purchase_root" sequence="1"/>
10
11      <!--supplier menu-->
12      <menuitem id="menu_procurement_management_supplier" name="Suppliers"
13             parent="menu_purchase_root" sequence="3"/>
14      <menuitem id="menu_procurement_management_supplier_name" name="Suppliers"
15             parent="menu_procurement_management_supplier" action="base.action_partner_supplier_form" />
16
17
18
19           <!--Inventory control-->
20       <menuitem id="menu_procurement_management_nventory" name="Inventory Control"
21             parent="menu_purchase_root" sequence="4"/>
22       <menuitem action="stock.action_picking_tree4" id="menu_action_picking_tree4" parent="menu_procurement_management_nventory"
23                 name="Incoming shipments" sequence="9"/>
24         <menuitem action="stock.action_reception_picking_move" id="menu_action_reception_picking_move"
25                 name="Incoming Products" parent="menu_procurement_management_nventory" sequence="10"/>
26
27      <!--Invoice control-->
28       <menuitem id="menu_procurement_management_invoice" name="Invoice Control"
29             parent="menu_purchase_root" sequence="6"/>
30      <menuitem name="Pending Invoices" id="menu_procurement_management_panding_invoice" action="account.action_invoice_tree_panding_invoice"
31       parent="menu_procurement_management_invoice"/>
32
33       <!--product menu-->
34       <menuitem id="menu_procurement_management_product" name="Product"
35             parent="menu_purchase_root" sequence="8"/>
36       <menuitem name="Products" id="menu_procurement_partner_contact_form" action="product.product_normal_action_puchased"
37       parent="menu_procurement_management_product"/>
38
39        <record model="ir.ui.view" id="purchase_order_calendar">
40             <field name="name">purchase.order.calendar</field>
41             <field name="model">purchase.order</field>
42             <field name="type">calendar</field>
43             <field name="priority" eval="2"/>
44             <field name="arch" type="xml">
45                 <calendar string="Calendar View" date_start="minimum_planned_date" color="partner_id">
46                     <field name="name"/>
47                     <field name="amount_total"/>
48                     <field name="partner_id"/>
49                 </calendar>
50             </field>
51         </record>
52         <record model="ir.ui.view" id="view_purchase_order_graph">
53             <field name="name">purchase.order.graph</field>
54             <field name="model">purchase.order</field>
55             <field name="type">graph</field>
56             <field name="arch" type="xml">
57                 <graph string="Purchase Order" type="bar">
58                     <field name="partner_id"/>
59                     <field name="amount_total" operator="+"/>
60                 </graph>
61             </field>
62         </record>
63
64         <record id="purchase_order_form" model="ir.ui.view">
65             <field name="name">purchase.order.form</field>
66             <field name="model">purchase.order</field>
67             <field name="type">form</field>
68             <field name="arch" type="xml">
69                 <form string="Purchase Order">
70                     <group col="6" colspan="4">
71                         <field name="name" select="1"/>
72                         <field name="date_order" select="2"/>
73                         <field name="invoiced" select="2"/>
74                         <newline/>
75                         <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection"/>
76                         <field name="origin" select="2"/>
77                         <field name="shipped" select="2"/>
78                         <field name="company_id" groups="base.group_multi_company" widget="selection"/>
79                     </group>
80                     <notebook colspan="4">
81                         <page string="Purchase Order">
82                             <field name="partner_id" on_change="onchange_partner_id(partner_id)" select="1" domain="[('supplier','=', 1)]"/>
83                             <field name="partner_address_id"/>
84                             <field domain="[('type','=','purchase')]" name="pricelist_id"/>
85                             <field name="partner_ref" select="2"/>
86                             <newline/>
87                             <field colspan="4" name="order_line" nolabel="1" mode="tree,form">
88                                 <tree colors="red:date_planned&lt;=current_date;black:date_planned&gt;current_date" string="Purchase Order Lines">
89                                     <field name="date_planned"/>
90                                     <field name="name"/>
91                                     <field name="product_id"/>
92                                     <field name="product_qty"/>
93                                     <field name="product_uom"/>
94                                     <field name="price_unit"/>
95                                     <field name="price_subtotal"/>
96                                 </tree>
97                                 <!-- default form view -->
98                             </field>
99                             <group col="7" colspan="4">
100                                 <field name="amount_untaxed" sum="Untaxed amount"/>
101                                 <field name="amount_tax"/>
102                                 <field name="amount_total" sum="Total amount"/>
103                                 <button name="button_dummy" states="draft" string="Compute" type="object" icon="gtk-execute"/>
104                             </group>
105                             <group col="11" colspan="4">
106                                 <field name="state" readonly="1"/>
107                                 <button name="purchase_confirm" states="draft" string="Confirm Purchase Order" icon="gtk-apply"/>
108                                 <button name="purchase_appbuyer" states="wait_auth" string="Approve Purchase" icon="gtk-ok"/>
109                                 <button name="purchase_approve" states="confirmed" string="Approved by Supplier" icon="gtk-ok"/>
110                                 <button name="purchase_cancel" states="draft,confirmed,wait_auth" string="Cancel Purchase Order" icon="gtk-cancel"/>
111                                 <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="gtk-convert"/>
112                                 <button name="action_cancel" states="approved,except_picking,except_invoice" string="Cancel Purchase Order" type="object" icon="gtk-cancel"/>
113
114                                 <button name="picking_ok" states="except_picking" string="Manually Corrected" icon="gtk-convert"/>
115                                 <button name="invoice_ok" states="except_invoice" string="Manually Corrected" icon="gtk-convert"/>
116                             </group>
117                         </page>
118                         <page string="Delivery &amp; Invoices" groups="account.group_account_user">
119                             <group colspan="2" col="2">
120                                 <separator string="Delivery" colspan="2"/>
121                                 <field name="dest_address_id" on_change="onchange_dest_address_id(dest_address_id)"/>
122                                 <field name="minimum_planned_date"/>
123                                 <field name="location_id" widget="selection"/>
124                             </group>
125                             <group colspan="2" col="2">
126                                 <separator string="Invoice Control" colspan="2"/>
127                                 <field name="invoice_method"/>
128                                 <field name="invoice_id" readonly="1"/>
129                                 <field name="fiscal_position" groups="base.group_extended" widget="selection"/>
130                             </group>
131                             <newline/>
132                             <separator string="Purchase Control" colspan="4"/>
133                             <field name="validator"/>
134                             <field name="date_approve"/>
135                         </page>
136                         <page string="Notes">
137                             <field colspan="4" name="notes" nolabel="1"/>
138                         </page>
139                     </notebook>
140                 </form>
141             </field>
142         </record>
143
144        <record id="view_purchase_order_filter" model="ir.ui.view">
145             <field name="name">purchase.order.list.select</field>
146             <field name="model">purchase.order</field>
147             <field name="type">search</field>
148             <field name="arch" type="xml">
149                 <search string="Search Purchase Order">
150                  <group col='10' colspan='4'>
151                     <filter icon="terp-purchase" string="Quotations" domain="[('state','=','draft')]" separator="1"/>
152                     <filter icon="terp-purchase" string="Unapproved" domain="[('state','in',('wait','confirmed'))]" separator="1"/>
153                     <separator orientation="vertical"/>
154                     <filter icon="terp-purchase" string="To Invoice" domain="[('invoiced','=',1)]" separator="1"/>
155                     <separator orientation="vertical"/>
156                     <field name="name" select="1"/>
157                     <field name="partner_id" select="1"/>
158                     <field name="product_id" select="1"/>
159                     <field name="create_uid" select="1" widget="selection">
160                         <filter icon="terp-purchase" domain="[('create_uid','=',uid)]" help="My Purchase Orders"/>
161                         <filter icon="terp-purchase" domain="[('create_uid','child_of',[uid])]" help="My Departments Purchase Orders"/>
162                     </field>
163                 </group>
164               </search>
165             </field>
166         </record>
167
168         <record id="purchase_form_action" model="ir.actions.act_window">
169             <field name="name">Purchase Orders</field>
170             <field name="type">ir.actions.act_window</field>
171             <field name="res_model">purchase.order</field>
172             <field name="view_mode">tree,form,calendar,graph</field>
173             <field name="search_view_id" ref="view_purchase_order_filter"/>
174         </record>
175         <menuitem action="purchase_form_action" id="menu_purchase_form_action" parent="menu_procurement_management"/>
176
177         <record id="purchase_form_action4" model="ir.actions.act_window">
178             <field name="name">Purchase Orders in Progress</field>
179             <field name="type">ir.actions.act_window</field>
180             <field name="res_model">purchase.order</field>
181             <field name="view_type">form</field>
182             <field name="view_mode">tree,form,calendar,graph</field>
183             <field name="domain">[('state','=','approved')]</field>
184             <field name="search_view_id" ref="view_purchase_order_filter"/>
185         </record>
186
187         <record id="purchase_order_tree" model="ir.ui.view">
188             <field name="name">purchase.order.tree</field>
189             <field name="model">purchase.order</field>
190             <field name="type">tree</field>
191             <field name="arch" type="xml">
192                 <tree string="Purchase Order">
193                     <field name="name" string="Reference"/>
194                     <field name="date_order"/>
195                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
196                     <field name="minimum_planned_date"/>
197                     <field name="partner_id"/>
198                     <field name="location_id"/>
199                     <field name="invoiced_rate" widget="progressbar"/>
200                     <field name="shipped_rate" widget="progressbar"/>
201                     <field name="amount_untaxed"/>
202                     <field name="origin"/>
203                     <field name="state"/>
204                 </tree>
205             </field>
206         </record>
207
208         <record id="purchase_order_line_form" model="ir.ui.view">
209             <field name="name">purchase.order.line.form</field>
210             <field name="model">purchase.order.line</field>
211             <field name="type">form</field>
212             <field name="arch" type="xml">
213                 <form string="Purchase Order Line">
214                     <notebook colspan="4">
215                         <page string="Order Line">
216                             <field colspan="4" context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" name="product_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)"/>
217                             <field context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" name="product_qty" 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)"/>
218                             <field name="product_uom" on_change="product_uom_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order)"/>
219                             <field colspan="4" name="name"/>
220                             <field name="date_planned"/>
221                             <field name="price_unit"/>
222                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
223                             <field name="price_subtotal" readonly="1"/>
224                         </page>
225                         <page string="Notes">
226                             <field colspan="4" name="notes" nolabel="1"/>
227                         </page>
228                         <page string="History" groups="base.group_extended,stock.group_stock_user">
229                                <separator colspan="4" string="Stock Moves"/>
230                                <field colspan="4" name="move_ids" nolabel="1" widget="many2many"/>
231                         </page>
232                         <page string="Invoicing" groups="account.group_account_user">
233                             <field name="account_analytic_id" colspan="4"/>
234                             <separator colspan="4" string="Taxes"/>
235                             <field colspan="4" nolabel="1" name="taxes_id" domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
236                         </page>
237                     </notebook>
238                 </form>
239             </field>
240         </record>
241
242         <record id="purchase_order_line_tree" model="ir.ui.view">
243             <field name="name">purchase.order.line.tree</field>
244             <field name="model">purchase.order.line</field>
245             <field name="type">tree</field>
246             <field name="arch" type="xml">
247                 <tree colors="red:date_planned&lt;=current_date;black:date_planned&gt;current_date" string="Purchase Order Lines">
248                     <field name="order_id"/>
249                     <field name="name"/>
250                     <field name="date_planned"/>
251                     <field name="product_id"/>
252                     <field name="product_qty"/>
253                     <field name="product_uom"/>
254                     <field name="price_unit"/>
255                     <field name="price_subtotal"/>
256                 </tree>
257             </field>
258         </record>
259
260         <act_window
261             context="{'partner_id': active_id}"
262             domain="[('partner_id', '=', active_id)]"
263             id="act_res_partner_2_purchase_order"
264             name="Purchase orders"
265             res_model="purchase.order"
266             src_model="res.partner"/>
267
268         <act_window
269             domain="[('product_id','=',active_id)]"
270             id="action_purchase_line_product_tree"
271             name="Product purchases"
272             res_model="purchase.order.line"
273             src_model="product.product"/>
274
275     </data>
276 </openerp>