[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_ids" widget="mail_thread"/>
106             </div> 
107             </form>
108         </field>
109     </record>
110     <record model="ir.ui.view" id="view_purchase_requisition_tree">
111         <field name="name">purchase.requisition.tree</field>
112         <field name="model">purchase.requisition</field>
113         <field name="arch" type="xml">
114             <tree fonts="bold:message_state==True" colors="grey:state == 'cancel';red:date_end and date_end&lt;current_date;black:date_end&gt;current_date;" string="Purchase Requisition">
115                 <field name="message_state" invisible="1"/>
116                 <field name="name"/>
117                 <field name="date_start"/>
118                 <field name="user_id"/>
119                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
120                 <field name="date_end"/>
121                 <field name="origin"/>
122                 <field name="state"/>
123             </tree>
124       </field>
125     </record>
126
127     <record id="view_purchase_requisition_filter" model="ir.ui.view">
128             <field name="name">purchase.requisition.list.select</field>
129             <field name="model">purchase.requisition</field>
130             <field name="arch" type="xml">
131                 <search string="Search Purchase Requisition">
132                     <field name="name" string="Purchase Requisition"/>
133                     <field name="exclusive" />
134                     <filter icon="terp-document-new" name="draft" string="New" domain="[('state','=','draft')]" help="New Purchase Requisition"/>
135                     <filter icon="terp-camera_test" string="Sent to Suppliers" domain="[('state','=','in_progress')]" help="Purchase Requisition in negociation"/>
136                     <filter icon="terp-dialog-close" string="Purchase Done" domain="[('state','=','done')]" help="Current Purchase Requisition"/>
137                     <separator/>
138                     <filter icon="terp-personal-" string="Unassigned"  domain="[('user_id','=', False)]" help="Unassigned  Requisition"/>
139                     <field name="user_id" />
140                     <group expand="0" string="Group By...">
141                         <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
142                         <filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
143                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
144                         <filter string="Start Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}"/>
145                         <filter string="End Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_end'}"/>
146                     </group>
147                 </search>
148             </field>
149         </record>
150
151
152     <record model="ir.actions.act_window" id="action_purchase_requisition">
153         <field name="name">Purchase Requisitions</field>
154         <field name="type">ir.actions.act_window</field>
155         <field name="res_model">purchase.requisition</field>
156         <field name="view_type">form</field>
157         <field name="view_mode">tree,form</field>
158         <field name="context">{"search_default_create_uid":uid}</field>
159         <field name="search_view_id" ref="view_purchase_requisition_filter"/>
160         <field name="help" type="html">
161           <p class="oe_view_nocontent_create">
162             Click to start a new purchase requisition process. 
163           </p><p>
164             A purchase requisition is the step before a request for quotation.
165             In a purchase requisition (or purchase tender), you can record the
166             products you need to buy and trigger the creation of RfQs to
167             suppliers. After the negotiation, once you have reviewed all the
168             supplier's offers, you can validate some and cancel others.
169           </p>
170         </field>
171     </record>
172
173     <menuitem
174         id="menu_purchase_requisition_pro_mgt"
175         sequence="10"
176         parent="purchase.menu_procurement_management"
177         action="action_purchase_requisition"/>
178
179     <record model="ir.ui.view" id="product_normal_form_view_inherit">
180         <field name="name">product.form.inherit</field>
181         <field name="model">product.product</field>
182         <field name="inherit_id" ref="product.product_normal_form_view"/>
183         <field name="arch" type="xml">
184             <field name="supply_method" position="after">
185                 <group colspan="2" col="2" attrs="{'invisible': [('supply_method','&lt;&gt;','buy')]}">
186                 <field name="purchase_requisition"/>
187                 </group>
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>