[IMP]: Removed duplicated by.. from Group by
[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="Purchase Management"
5             groups="group_purchase_user"/>-->
6        <menuitem icon="terp-purchase" id="base.menu_purchase_root" name="Procurement Management"
7             groups="group_purchase_user" sequence="7"/>
8            <menuitem id="menu_procurement_management" name="Procurement Management"
9             parent="base.menu_purchase_root" sequence="1"/>
10
11      <!--supplier menu-->
12      <menuitem id="base.menu_procurement_management_supplier" name="Suppliers"
13             parent="base.menu_purchase_root" sequence="3"/>
14      <menuitem id="menu_procurement_management_supplier_name" name="Suppliers"
15             parent="base.menu_procurement_management_supplier" action="base.action_partner_supplier_form" sequence="1"/>
16
17
18
19           <!--Inventory control-->
20       <menuitem id="menu_procurement_management_nventory" name="Inventory Control"
21             parent="base.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="base.menu_purchase_root" sequence="6"/>
30      <menuitem name="Pending Invoices" id="menu_procurement_management_pending_invoice" action="account.action_invoice_tree_pending_invoice"
31       parent="menu_procurement_management_invoice"/>
32
33       <!--product menu-->
34       <menuitem id="menu_procurement_management_product" name="Product"
35             parent="base.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" string="Reference"/>
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-partner" domain="[('create_uid','=',uid)]" help="My Purchase Orders"/>                        
161                     </field>
162                 </group>
163                                 <group expand="1" string="Group By..." colspan="4" col="10">
164                                         <filter string="Supplier" icon="terp-purchase" domain="[]" context="{'group_by':'partner_id'}"/>        
165                     <filter string="State" icon="terp-sale" domain="[]" context="{'group_by':'state'}"/>                                
166                                         <filter string="Order Date" icon="terp-purchase" domain="[]" context="{'group_by':'date_order'}"/>
167                                 </group>
168               </search>
169             </field>
170         </record>
171
172         <record id="purchase_rfq" model="ir.actions.act_window">
173             <field name="name">Quotation Request</field>
174             <field name="type">ir.actions.act_window</field>
175             <field name="res_model">purchase.order</field>
176             <field name="view_type">form</field>
177             <field name="domain">[('state','=','draft')]</field>
178             <field name="view_mode">tree,form</field>  
179             <field name="search_view_id" ref="view_purchase_order_filter"/>          
180         </record>
181             <menuitem action="purchase_rfq" id="menu_purchase_rfq" parent="menu_procurement_management" 
182                         name="Request for Quotations" sequence="6"/>
183
184         <record id="purchase_form_action" model="ir.actions.act_window">
185             <field name="name">Purchase Orders</field>
186             <field name="type">ir.actions.act_window</field>
187             <field name="res_model">purchase.order</field>
188             <field name="view_mode">tree,form,calendar,graph</field>
189             <field name="search_view_id" ref="view_purchase_order_filter"/>
190         </record>
191         <menuitem action="purchase_form_action" id="menu_purchase_form_action" parent="menu_procurement_management"/>
192
193         <record id="purchase_form_action4" model="ir.actions.act_window">
194             <field name="name">Purchase Orders in Progress</field>
195             <field name="type">ir.actions.act_window</field>
196             <field name="res_model">purchase.order</field>
197             <field name="view_type">form</field>
198             <field name="view_mode">tree,form,calendar,graph</field>
199             <field name="domain">[('state','=','approved')]</field>
200             <field name="search_view_id" ref="view_purchase_order_filter"/>
201         </record>
202
203         <record id="purchase_order_tree" model="ir.ui.view">
204             <field name="name">purchase.order.tree</field>
205             <field name="model">purchase.order</field>
206             <field name="type">tree</field>
207             <field name="arch" type="xml">
208                 <tree string="Purchase Order">
209                     <field name="name" string="Reference"/>
210                     <field name="origin"/>
211                     <field name="date_order" string="Order Date"/>
212                     <field name="partner_id"/>
213                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
214                     <field name="location_id"/>
215                     <field name="minimum_planned_date"/>
216                     <field name="invoiced_rate" widget="progressbar"/>
217                     <field name="shipped_rate" widget="progressbar"/>
218                     <field name="amount_untaxed" sum="Total Untaxed amount"/>                               
219                     <field name="amount_total" sum="Total amount"/>
220                     <field name="state"/>
221                 </tree>
222             </field>
223         </record>
224
225         <record id="purchase_order_line_form" model="ir.ui.view">
226             <field name="name">purchase.order.line.form</field>
227             <field name="model">purchase.order.line</field>
228             <field name="type">form</field>
229             <field name="arch" type="xml">
230                 <form string="Purchase Order Line">
231                     <notebook colspan="4">
232                         <page string="Order Line">
233                             <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)"/>
234                             <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)"/>
235                             <field name="product_uom" on_change="product_uom_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order)"/>
236                             <field colspan="4" name="name"/>
237                             <field name="date_planned" widget="date"/>
238                             <field name="price_unit"/>
239                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
240                             <field name="price_subtotal" readonly="1"/>
241                         </page>
242                         <page string="Notes">
243                             <field colspan="4" name="notes" nolabel="1"/>
244                         </page>
245                         <page string="History" groups="base.group_extended,stock.group_stock_user">
246                                <separator colspan="4" string="Stock Moves"/>
247                                <field colspan="4" name="move_ids" nolabel="1" widget="many2many"/>
248                         </page>
249                         <page string="Invoicing" groups="account.group_account_user">
250                             <field name="account_analytic_id" colspan="4"/>
251                             <separator colspan="4" string="Taxes"/>
252                             <field colspan="4" nolabel="1" name="taxes_id" domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
253                         </page>
254                     </notebook>
255                 </form>
256             </field>
257         </record>
258
259         <record id="purchase_order_line_tree" model="ir.ui.view">
260             <field name="name">purchase.order.line.tree</field>
261             <field name="model">purchase.order.line</field>
262             <field name="type">tree</field>
263             <field name="arch" type="xml">
264                 <tree colors="red:date_planned&lt;=current_date;black:date_planned&gt;current_date" string="Purchase Order Lines">
265                     <field name="order_id"/>
266                     <field name="name"/>
267                     <field name="date_planned" widget="date"/>
268                     <field name="product_id"/>
269                     <field name="product_qty"/>
270                     <field name="product_uom"/>
271                     <field name="price_unit"/>
272                     <field name="price_subtotal"/>
273                 </tree>
274             </field>
275         </record>
276
277         <act_window
278             context="{'partner_id': active_id}"
279             domain="[('partner_id', '=', active_id)]"
280             id="act_res_partner_2_purchase_order"
281             name="Purchase orders"
282             res_model="purchase.order"
283             src_model="res.partner"/>
284
285         <act_window
286             domain="[('product_id','=',active_id)]"
287             id="action_purchase_line_product_tree"
288             name="Product purchases"
289             res_model="purchase.order.line"
290             src_model="product.product"/>
291
292     </data>
293 </openerp>