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