[FIX]: ADD RFQ button below RFQ o2m fields.
[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="//filter[@name='approved']" position="after">
25                 <filter icon="terp-gtk-jump-to-rtl" string="Requisition" domain="[('requisition_id','!=',False)]"  help="Purchase Orders with requisition"/>
26             </xpath>
27         </field>
28     </record>
29
30     <record model="ir.ui.view" id="view_purchase_requisition_form">
31         <field name="name">purchase.requisition.form</field>
32         <field name="type">form</field>
33         <field name="model">purchase.requisition</field>
34         <field name="arch" type="xml">
35             <form layout="manual">
36             <header>
37                 <button name="tender_in_progress" states="draft" string="Send to Suppliers" type="object" />
38                 <button name="tender_reset" states="done,cancel" string="Reset to Draft" type="object" />
39                 <button name="tender_done" states="in_progress" string=" Purchase Done" type="object" />
40                 <button name="tender_cancel" states="draft,in_progress" string="Cancel" type="object" />
41                 <field name="state" readonly="1" widget="statusbar" statusbar_visible="draft,in_progress,done" statusbar_colors='{"in_progress":"blue"}'/>
42             </header>
43             <sheet string="Purchase Requisition" layout="auto">
44             <group colspan="4" col="4" class="oe_form_group_label_border">
45                <field name="name"/>
46                <field name="exclusive"/>
47                <field name="user_id"/>
48                <field name="date_start"/>
49                <field name="origin"/>
50                <field name="date_end"/>
51                <field name="warehouse_id" widget="selection" groups="stock.group_locations"/>
52                <field name="company_id" groups="base.group_multi_company" widget="selection"/>
53                 </group>
54                 <notebook colspan="4">
55                     <page string="Products">
56                         <field name="line_ids" colspan="4" nolabel="1">
57                             <tree string="Products" editable="bottom">
58                                 <field name="product_id" on_change="onchange_product_id(product_id,product_uom_id)"/>
59                                 <field name="product_qty"/>
60                                 <field name="product_uom_id" groups="product.group_uom"/>
61                             </tree>
62                             <form string="Products">
63                                 <field name="product_id"/>
64                                 <field name="product_qty"/>
65                                 <field name="product_uom_id" groups="product.group_uom"/>
66                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
67                             </form>
68                         </field>
69                         <separator colspan="4" string="Quotations"/>
70                         <field colspan="4" name="purchase_ids" nolabel="1" mode="tree,form" readonly="1" >
71                             <tree string="Purchase Order">
72                                 <field name="name" string="Reference"/>
73                                 <field name="date_order" string="Order Date"/>
74                                 <field name="partner_id"/>
75                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
76                                 <field name="location_id"/>
77                                 <field name="minimum_planned_date"/>
78                                 <field name="origin"/>
79                                 <field name="state"/>
80                                 <button name="purchase_cancel" states="draft,confirmed,wait_auth" string="Cancel Purchase Order" icon="gtk-cancel"/>                                
81                                 <button name="purchase_confirm" states="draft" string="Confirm Purchase Order" icon="gtk-apply"/>
82                                 <button name="purchase_approve" states="confirmed" string="Approved by Supplier" icon="gtk-ok"/>
83                             </tree>
84                          </field>
85                          <group colspan="4" col="4">
86                             <button name="%(action_purchase_requisition_partner)d" string="Request a Quotation" type="action" icon="gtk-execute"
87                             attrs="{'invisible': [('line_ids','=',False),('state', 'not in', ('in_progress'))]}"/>
88                             <group cosplan="4" col="4">
89                                 <label   string="" />
90                             </group>
91                         </group>                             
92                     </page>
93                     <page string="Notes">
94                         <field name="description" colspan="4" nolabel="1"/>
95                     </page>
96                 </notebook>
97             </sheet>
98             <div class="oe_form_sheet_width">
99                   <field name="message_ids" colspan="4" widget="ThreadView" nolabel="1"/>
100             </div> 
101             </form>
102         </field>
103     </record>
104     <record model="ir.ui.view" id="view_purchase_requisition_tree">
105         <field name="name">purchase.requisition.tree</field>
106         <field name="type">tree</field>
107         <field name="model">purchase.requisition</field>
108         <field name="arch" type="xml">
109             <tree fonts="bold:needaction_pending==True" colors="grey:state == 'cancel';red:date_end&lt;current_date;black:date_end&gt;=current_date;" string="Purchase Requisition">
110                 <field name="needaction_pending" invisible="1"/>
111                 <field name="name"/>
112                 <field name="date_start"/>
113                 <field name="user_id"/>
114                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
115                 <field name="date_end"/>
116                 <field name="origin"/>
117                 <field name="state"/>
118             </tree>
119       </field>
120     </record>
121
122     <record id="view_purchase_requisition_filter" model="ir.ui.view">
123             <field name="name">purchase.requisition.list.select</field>
124             <field name="model">purchase.requisition</field>
125             <field name="type">search</field>
126             <field name="arch" type="xml">
127                 <search string="Search Purchase Requisition">
128                  <group>
129                     <filter icon="terp-document-new" name="draft" string="New" domain="[('state','=','draft')]" help="New Purchase Requisition"/>
130                     <filter icon="terp-camera_test" string="Sent to Suppliers" domain="[('state','=','in_progress')]" help="Purchase Requisition in negociation"/>
131                     <filter icon="terp-dialog-close" string="Purchase Done" domain="[('state','=','done')]" help="Current Purchase Requisition"/>
132                     <separator orientation="vertical"/>
133                     <filter icon="terp-personal-" string="Unassigned"  domain="[('user_id','=', False)]" help="Unassigned  Requisition"/>
134                     <separator orientation="vertical"/>
135                     <field name="name"/>
136                     <field name="user_id" />
137                     <field name="exclusive" />
138                 </group>
139                 <newline/>
140                   <group expand="0" string="Group By...">
141                     <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
142                     <separator orientation="vertical"/>
143                     <filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
144                     <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
145                     <separator orientation="vertical"/>
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">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>
163     </record>
164
165     <menuitem
166         id="menu_purchase_requisition_pro_mgt"
167         sequence="10"
168         parent="purchase.menu_procurement_management"
169         action="action_purchase_requisition"/>
170
171     <record model="ir.ui.view" id="product_normal_form_view_inherit">
172         <field name="name">product.form.inherit</field>
173         <field name="type">form</field>
174         <field name="model">product.product</field>
175         <field name="inherit_id" ref="product.product_normal_form_view"/>
176         <field name="arch" type="xml">
177             <field name="supply_method" position="after">
178                 <group colspan="2" col="2" attrs="{'invisible': [('supply_method','&lt;&gt;','buy')]}">
179                 <field name="purchase_requisition"/>
180                 </group>
181             </field>
182         </field>
183     </record>
184
185     <record model="ir.ui.view" id="procurement_normal_form_view_inherit">
186         <field name="name">procurement.form.inherit</field>
187         <field name="type">form</field>
188         <field name="model">procurement.order</field>
189         <field name="inherit_id" ref="procurement.procurement_form_view"/>
190         <field name="arch" type="xml">
191              <xpath expr="//field[@name='close_move']" position="after">
192                 <field name="requisition_id"/>
193             </xpath>
194         </field>
195     </record>
196     <act_window
197             domain="[('requisition_id', '=', active_id)]"
198             context="{'default_requisition_id': active_id}"
199             id="act_res_partner_2_purchase_order"
200             name="Purchase orders"
201             res_model="purchase.order"
202             src_model="purchase.requisition"/>
203
204     </data>
205 </openerp>