d09564f221ee1b08059cf089bfca3ecadf50158c
[odoo/odoo.git] / addons / purchase_requisition / purchase_requisition_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4
5
6     <record model="ir.ui.view" id="purchase_order_form_inherit">
7         <field name="name">purchase.order.form.inherit</field>
8         <field name="type">form</field>
9         <field name="model">purchase.order</field>
10         <field name="inherit_id" ref="purchase.purchase_order_form"/>
11         <field name="arch" type="xml">
12             <field name="shipped" position="after">
13                 <field name="requisition_id"/>
14             </field>
15         </field>
16     </record>
17
18     <record model="ir.ui.view" id="purchase_order_search_inherit">
19         <field name="name">purchase.order.list.select.inherit</field>
20         <field name="type">form</field>
21         <field name="model">purchase.order</field>
22         <field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
23         <field name="arch" type="xml">
24             <xpath expr="/search/group/filter[@name='not_invoiced']" position="after">
25              <separator orientation="vertical"/>
26              <filter icon="terp-gtk-jump-to-rtl" string="Requisition" domain="[('requisition_id','!=',False)]"  help="Purchase Orders with requisition"/>
27             </xpath>
28         </field>
29     </record>
30
31     <record model="ir.ui.view" id="request_for_quotation_inherit">
32         <field name="name">request.for.quotation.select.inherit</field>
33         <field name="type">form</field>
34         <field name="model">purchase.order</field>
35         <field name="inherit_id" ref="purchase.view_request_for_quotation_filter"/>
36         <field name="arch" type="xml">
37             <xpath expr="/search/group/filter[@name='not_invoiced']" position="after">
38              <separator orientation="vertical"/>
39              <filter icon="terp-gtk-jump-to-rtl" string="Requisition" domain="[('requisition_id','!=',False)]"  help="Purchase Orders with requisition"/>
40             </xpath>
41         </field>
42     </record>
43
44     <record model="ir.ui.view" id="view_purchase_requisition_form">
45         <field name="name">purchase.requisition.form</field>
46         <field name="type">form</field>
47         <field name="model">purchase.requisition</field>
48         <field name="arch" type="xml">
49             <form layout="manual">
50             <div class="oe_form_topbar">
51                 <button name="tender_in_progress" states="draft" string="Start" type="object" />
52                 <button name="tender_reset" states="done,cancel" string="Reset to Draft" type="object" />
53                 <button name="tender_done" states="in_progress" string="Done" type="object" />
54                 <button name="tender_cancel" states="draft,in_progress" string="Cancel" type="object" />
55                 <div class="oe_right">
56                     <field name="state" nolabel="1" select="1" readonly ="1" widget="statusbar" statusbar_visible="draft,in_progress,done" statusbar_colors='{"in_progress":"blue"}'/>
57                 </div>
58                 <div class="oe_clear"/>
59             </div>
60             <sheet string="Purchase Requisition" layout="auto">
61                 <group colspan="4" col="6">
62                     <field name="name"/>
63                     <field name="user_id"/>
64                     <field name="exclusive"/>
65                     <field name="date_start"/>
66                     <field name="date_end"/>
67                     <field name="origin"/>
68                     <field name="warehouse_id" widget="selection"/>
69                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
70                 </group>
71                 <notebook colspan="4">
72                     <page string="Products">
73                         <field name="line_ids" colspan="4" nolabel="1">
74                             <tree string="Products" editable="bottom">
75                                 <field name="product_id" on_change="onchange_product_id(product_id,product_uom_id)"/>
76                                 <field name="product_qty"/>
77                                 <field name="product_uom_id"/>
78                             </tree>
79                             <form string="Products">
80                                 <field name="product_id" />
81                                 <field name="product_qty"/>
82                                 <field name="product_uom_id" />
83                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
84                             </form>
85
86                         </field>
87                     </page>
88                     <page string="Quotations">
89                         <field colspan="4" name="purchase_ids" nolabel="1" mode="tree,form">
90                             <tree string="Purchase Order">
91                                 <field name="name" string="Reference"/>
92                                 <field name="date_order" string="Order Date"/>
93                                 <field name="partner_id"/>
94                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
95                                 <field name="location_id"/>
96                                 <field name="minimum_planned_date"/>
97                                 <field name="origin"/>
98                                 <field name="state"/>
99                                 <button name="purchase_cancel" states="draft,confirmed,wait_auth" string="Cancel Purchase Order" icon="gtk-cancel"/>                                
100                                 <button name="purchase_confirm" states="draft" string="Confirm Purchase Order" icon="gtk-apply"/>
101                                 <button name="purchase_approve" states="confirmed" string="Approved by Supplier" icon="gtk-ok"/>
102                             </tree>
103                          </field>
104                         <separator colspan="4" string=""/>
105                          <group col="8" colspan="4">
106                           <label colspan="6"  string=""/>
107                         <button name="%(action_purchase_requisition_partner)d" string="Request a Quotation" type="action" icon="gtk-execute"
108                            attrs="{'readonly': [('state', '=', 'done')]}" />
109                         </group>
110                    </page>
111                     <page string="Notes">
112                         <field name="description" colspan="4" nolabel="1"/>
113                     </page>
114                 </notebook>
115             </sheet>
116             </form>
117         </field>
118     </record>
119     <record model="ir.ui.view" id="view_purchase_requisition_tree">
120         <field name="name">purchase.requisition.tree</field>
121         <field name="type">tree</field>
122         <field name="model">purchase.requisition</field>
123         <field name="arch" type="xml">
124             <tree colors="grey:state == 'done';red:date_end&lt;current_date and state not in ('done','cancel');black:date_end&gt;=current_date;" string="Purchase Requisition">
125                 <field name="name"/>
126                 <field name="user_id"/>
127                 <field name="date_start"/>
128                 <field name="date_end"/>
129                 <field name="origin"/>
130                 <field name="state"/>
131             </tree>
132         </field>
133     </record>
134
135     <record id="view_purchase_requisition_filter" model="ir.ui.view">
136             <field name="name">purchase.requisition.list.select</field>
137             <field name="model">purchase.requisition</field>
138             <field name="type">search</field>
139             <field name="arch" type="xml">
140                 <search string="Search Purchase Requisition">
141                  <group>
142                     <filter icon="terp-document-new" name="draft" string="New" domain="[('state','=','draft')]" help="New Purchase Requisition"/>
143                     <filter icon="terp-camera_test" string="In Progress" domain="[('state','=','in_progress')]" help="Purchase Requisition in negociation"/>
144                     <filter icon="terp-dialog-close" string="Done" domain="[('state','=','done')]" help="Current Purchase Requisition"/>
145                     <separator orientation="vertical"/>
146                     <filter icon="terp-personal-" string="Unassigned"  domain="[('user_id','=', False)]" help="Unassigned  Requisition"/>
147                     <separator orientation="vertical"/>
148                     <field name="name"/>
149                     <field name="user_id" />
150                     <field name="exclusive" />
151                 </group>
152                 <newline/>
153                   <group expand="0" string="Group By...">
154                     <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
155                     <separator orientation="vertical"/>
156                     <filter string="Origin" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
157                     <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
158                     <separator orientation="vertical"/>
159                     <filter string="Start Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}"/>
160                     <filter string="End Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_end'}"/>
161                 </group>
162               </search>
163             </field>
164         </record>
165
166
167     <record model="ir.actions.act_window" id="action_purchase_requisition">
168         <field name="name">Purchase Requisitions</field>
169         <field name="type">ir.actions.act_window</field>
170         <field name="res_model">purchase.requisition</field>
171         <field name="view_type">form</field>
172         <field name="view_mode">tree,form</field>
173         <field name="context">{"search_default_create_uid":uid}</field>
174         <field name="search_view_id" ref="view_purchase_requisition_filter"/>
175         <field name="help">A purchase requisition is the step before a request for quotation. In a purchase requisition (or purchase tender), you can record the products you need to buy and trigger the creation of RfQs to suppliers. After the negotiation, once you have reviewed all the supplier's offers, you can validate some and cancel others.</field>
176     </record>
177
178     <menuitem
179         id="menu_purchase_requisition_pro_mgt"
180         sequence="0"
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>