[MERGE] trunk
[odoo/odoo.git] / addons / purchase_requisition / purchase_requisition_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4
5     <record model="ir.ui.view" id="purchase_order_form_inherit">
6         <field name="name">purchase.order.form.inherit</field>
7         <field name="model">purchase.order</field>
8         <field name="inherit_id" ref="purchase.purchase_order_form"/>
9         <field name="arch" type="xml">
10             <field name="validator" position="before">
11                 <field name="requisition_id"/>
12             </field>
13         </field>
14     </record>
15
16     <record model="ir.ui.view" id="purchase_order_search_inherit">
17         <field name="name">purchase.order.list.select.inherit</field>
18         <field name="model">purchase.order</field>
19         <field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
20         <field name="arch" type="xml">
21             <xpath expr="//filter[@name='approved']" position="after">
22                 <filter icon="terp-gtk-jump-to-rtl" string="Requisition" domain="[('requisition_id','!=',False)]"  help="Purchase Orders with requisition"/>
23             </xpath>
24         </field>
25     </record>
26
27     <record model="ir.ui.view" id="view_purchase_requisition_form">
28         <field name="name">purchase.requisition.form</field>
29         <field name="model">purchase.requisition</field>
30         <field name="arch" type="xml">
31             <form string="Purchase Requisition" version="7.0">
32             <header>
33                 <button name="tender_in_progress" states="draft" string="Send to Suppliers" type="object" class="oe_highlight"/>
34                 <button name="tender_reset" states="done,cancel" string="Reset to Draft" type="object" />
35                 <button name="tender_done" states="in_progress" string="Purchase Done" type="object" class="oe_highlight"/>
36                 <button name="tender_cancel" states="draft,in_progress" string="Cancel" type="object" />
37                 <field name="state" widget="statusbar" statusbar_visible="draft,in_progress,done" statusbar_colors='{"in_progress":"blue"}'/>
38             </header>
39             <sheet>
40                 <div class="oe_edit_only">
41                     <label for="name" class="oe_inline"/>
42                     <label for="origin" class="oe_inline"/>
43                 </div>
44                 <h1>
45                     <field name="name" class="oe_inline"/>
46                     <label string="," attrs="{'invisible':[('origin','=',False)]}"/>
47                     <field name="origin" class="oe_inline" placeholder="e.g. PO0025"/>
48                 </h1>
49                 <group>
50                     <group>
51                         <field name="user_id"/>
52                         <field name="exclusive"/>
53                     </group>
54                     <group>
55                         <field name="date_start"/>
56                         <field name="date_end"/>
57                         <field name="warehouse_id" widget="selection" groups="stock.group_locations"/>
58                         <field name="company_id" groups="base.group_multi_company" widget="selection"/>
59                     </group>
60                 </group>
61                 <notebook>
62                     <page string="Products">
63                         <field name="line_ids">
64                             <tree string="Products" editable="bottom">
65                                 <field name="product_id" on_change="onchange_product_id(product_id,product_uom_id)"/>
66                                 <field name="product_qty"/>
67                                 <field name="product_uom_id" groups="product.group_uom"/>
68                             </tree>
69                             <form string="Products" version="7.0">
70                                 <group>
71                                     <field name="product_id" />
72                                     <field name="product_qty"/>
73                                     <field name="product_uom_id" />
74                                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
75                                 </group>
76                             </form>
77                         </field>
78                         <div class="oe_right oe_button_box" style="margin-top: 10px">
79                             <button name="%(action_purchase_requisition_partner)d" type="action"
80                                 string="Request a Quotation" icon="gtk-execute"
81                                 attrs="{'invisible': [('line_ids','=',False),('state', 'not in', ('in_progress'))]}"/>
82                         </div>
83                         <separator string="Quotations"/>
84                         <field name="purchase_ids" readonly="1">
85                             <tree string="Purchase Order">
86                                 <field name="name" string="Reference"/>
87                                 <field name="date_order" string="Order Date"/>
88                                 <field name="partner_id"/>
89                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
90                                 <field name="location_id" groups="stock.group_locations"/>
91                                 <field name="minimum_planned_date"/>
92                                 <field name="origin"/>
93                                 <field name="state"/>
94                                 <button name="purchase_cancel" states="draft,confirmed,wait_auth" string="Cancel Purchase Order" icon="gtk-cancel"/>
95                                 <button name="purchase_confirm" states="draft" string="Confirm Purchase Order" icon="gtk-apply"/>
96                                 <button name="purchase_approve" states="confirmed" string="Approved by Supplier" icon="gtk-ok"/>
97                             </tree>
98                         </field>
99                         <separator string="Terms and Conditions"/>
100                         <field name="description"/>
101                     </page>
102                 </notebook>
103             </sheet>
104             <div class="oe_chatter">
105                 <field name="message_is_follower" invisible="1"/>
106                 <field name="message_ids" widget="mail_thread"/>
107                 <field name="message_follower_ids" widget="mail_followers"/>
108             </div> 
109             </form>
110         </field>
111     </record>
112     <record model="ir.ui.view" id="view_purchase_requisition_tree">
113         <field name="name">purchase.requisition.tree</field>
114         <field name="model">purchase.requisition</field>
115         <field name="arch" type="xml">
116             <tree fonts="bold:message_unread==True" colors="grey:state == 'cancel';red:date_end and date_end&lt;current_date;black:date_end&gt;current_date;" string="Purchase Requisition">
117                 <field name="message_unread" invisible="1"/>
118                 <field name="name"/>
119                 <field name="date_start"/>
120                 <field name="user_id"/>
121                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
122                 <field name="date_end"/>
123                 <field name="origin"/>
124                 <field name="state"/>
125             </tree>
126       </field>
127     </record>
128
129     <record id="view_purchase_requisition_filter" model="ir.ui.view">
130             <field name="name">purchase.requisition.list.select</field>
131             <field name="model">purchase.requisition</field>
132             <field name="arch" type="xml">
133                 <search string="Search Purchase Requisition">
134                     <field name="name" string="Purchase Requisition"/>
135                     <field name="exclusive" />
136                     <filter icon="terp-document-new" name="draft" string="New" domain="[('state','=','draft')]" help="New Purchase Requisition"/>
137                     <filter icon="terp-camera_test" string="Sent to Suppliers" domain="[('state','=','in_progress')]" help="Purchase Requisition in negociation"/>
138                     <filter icon="terp-dialog-close" string="Purchase Done" domain="[('state','=','done')]" help="Current Purchase Requisition"/>
139                     <separator/>
140                     <filter icon="terp-personal-" string="Unassigned"  domain="[('user_id','=', False)]" help="Unassigned  Requisition"/>
141                     <field name="user_id" />
142                     <group expand="0" string="Group By...">
143                         <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
144                         <filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
145                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
146                         <filter string="Start Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}"/>
147                         <filter string="End Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_end'}"/>
148                     </group>
149                 </search>
150             </field>
151         </record>
152
153
154     <record model="ir.actions.act_window" id="action_purchase_requisition">
155         <field name="name">Purchase Requisitions</field>
156         <field name="type">ir.actions.act_window</field>
157         <field name="res_model">purchase.requisition</field>
158         <field name="view_type">form</field>
159         <field name="view_mode">tree,form</field>
160         <field name="context">{"search_default_create_uid":uid}</field>
161         <field name="search_view_id" ref="view_purchase_requisition_filter"/>
162         <field name="help" type="html">
163           <p class="oe_view_nocontent_create">
164             Click to start a new purchase requisition process. 
165           </p><p>
166             A purchase requisition is the step before a request for quotation.
167             In a purchase requisition (or purchase tender), you can record the
168             products you need to buy and trigger the creation of RfQs to
169             suppliers. After the negotiation, once you have reviewed all the
170             supplier's offers, you can validate some and cancel others.
171           </p>
172         </field>
173     </record>
174
175     <menuitem
176         id="menu_purchase_requisition_pro_mgt"
177         sequence="10"
178         parent="purchase.menu_procurement_management"
179         action="action_purchase_requisition"/>
180
181     <record model="ir.ui.view" id="product_normal_form_view_inherit">
182         <field name="name">product.form.inherit</field>
183         <field name="model">product.product</field>
184         <field name="inherit_id" ref="product.product_normal_form_view"/>
185         <field name="arch" type="xml">
186             <field name="procure_method" position="before">
187                 <field name="purchase_requisition"/>
188             </field>
189         </field>
190     </record>
191
192     <record model="ir.ui.view" id="procurement_normal_form_view_inherit">
193         <field name="name">procurement.form.inherit</field>
194         <field name="model">procurement.order</field>
195         <field name="inherit_id" ref="procurement.procurement_form_view"/>
196         <field name="arch" type="xml">
197             <xpath expr="//field[@name='close_move']" position="after">
198                 <field name="requisition_id"/>
199             </xpath>
200         </field>
201     </record>
202     <act_window
203             domain="[('requisition_id', '=', active_id)]"
204             context="{'default_requisition_id': active_id}"
205             id="act_res_partner_2_purchase_order"
206             name="Purchase orders"
207             res_model="purchase.order"
208             src_model="purchase.requisition"/>
209
210     </data>
211 </openerp>