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